Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
tags-ignore:
- v*
paths:
- .github/workflows/lint.yml
- "**.go"
- go.mod
- go.sum
pull_request:
paths:
- .github/workflows/lint.yml
- "**.go"
- go.mod
- go.sum
Expand Down Expand Up @@ -52,6 +54,14 @@ jobs:
tar xz --strip-components 1 --wildcards \*/golangci-lint
mkdir -p bin && mv golangci-lint bin/

- name: Run Lint checks
run: |
bin/golangci-lint run --out-format=github-actions --timeout=3m || exit $?

- name: Build docs generator
run: |
go build -o bin/gen-docs cmd/gen-docs/gen-docs.go || exit $?

- name: Run checks
run: |
STATUS=0
Expand All @@ -65,9 +75,8 @@ jobs:
fi
}

assert-nothing-changed ./bin/gen-docs --doc-path ./docs --website
assert-nothing-changed go fmt ./...
assert-nothing-changed go mod tidy

bin/golangci-lint run --out-format=github-actions --timeout=3m || STATUS=$?

exit $STATUS
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ go.work

# Goreleaser output
dist/
bin/
8 changes: 4 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ builds:
- env:
- CGO_ENABLED=0
goos:
# - freebsd
# - darwin
- freebsd
- darwin
- windows
- linux
goarch:
- amd64
# - arm
# - arm64
- arm
- arm64
ldflags:
- -s -w -X github.com/tmeckel/azdo-cli/internal/build.Version={{.Version}} -X github.com/tmeckel/azdo-cli/internal/build.Commit={{.Commit}} -X github.com/tmeckel/azdo-cli/internal/build.Date={{time "2006-01-02"}}
main: ./cmd/azdo/azdo.go
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Azure DevOps CLI

`azdo` is Azure DevOps on the command line. It brings pull requests, issues, and
other Azure DevOps concepts to the terminal next to where you are already working with
`git` and your code.

Azure DevOps CLI is available for Azure DevOps organizations hosted in the
cloud. **Azure DevOps Server is not supported.**

## Documentation

For [installation options see below](#installation), for usage instructions [see the manual](./docs/azdo.md).


## Installation

For Windows, Mac OS(10.12+) or Linux, you can download a binary from the [releases page][].
7 changes: 1 addition & 6 deletions cmd/gen-docs/gen-docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,7 @@ func run(args []string) error {
}

func filePrepender(filename string) string {
return `---
layout: manual
permalink: /:path/:basename
---

`
return ""
}

func linkHandler(name string) string {
Expand Down
25 changes: 25 additions & 0 deletions docs/azdo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## azdo
Work seamlessly with Azure DevOps from the command line.
### Core commands
* [azdo auth](./azdo_auth)
* [azdo project](./azdo_project)
* [azdo repo](./azdo_repo)

### Additional commands
* [azdo config](./azdo_config)

### Options


* `--version`

Show azdo version


### Examples

```bash
$ azdo project list
$ azdo repo clone myorg/myrepo
```

11 changes: 11 additions & 0 deletions docs/azdo_auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## azdo auth
Authenticate azdo and git with Azure DevOps
### Available commands
* [azdo auth login](./azdo_auth_login)
* [azdo auth logout](./azdo_auth_logout)
* [azdo auth setup-git](./azdo_auth_setup-git)
* [azdo auth status](./azdo_auth_status)

### See also

* [azdo](./azdo)
54 changes: 54 additions & 0 deletions docs/azdo_auth_login.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## azdo auth login
```
azdo auth login [flags]
```
Authenticate with a Azure DevOps Organization.

The default authentication mode is a web-based browser flow. After completion, an
authentication token will be stored internally.

Alternatively, use `--with-token` to pass in a token on standard input.
The minimum required scopes for the token are: "repo", "read:org".

Alternatively, azdo will use the authentication token (PAT) found in environment variables.
This method is most suitable for "headless" use of azdo such as in automation. See
`azdo help environment` for more info.

To use azdo in Azure DevOps Pipeline Tasks (or other automation environments), add `AZDO_TOKEN: ${{ azdo.token }}` to "env".

### Options


* `-p`, `--git-protocol` `string`

The protocol to use for git operations: {ssh|https}

* `--insecure-storage`

Save authentication credentials in plain text instead of credential store

* `-o`, `--organizationUrl` `string`

The URL to the Azure DevOps organization to authenticate with

* `--with-token`

Read token from standard input


### Examples

```bash
# start interactive setup
$ azdo auth login

# authenticate by reading the token from a file
$ azdo auth login --with-token < mytoken.txt

# authenticate with a specific Azure DevOps Organization
$ azdo auth login --organizationUrl https://dev.azure.com/myorg
```

### See also

* [azdo auth](./azdo_auth)
30 changes: 30 additions & 0 deletions docs/azdo_auth_logout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## azdo auth logout
```
azdo auth logout [flags]
```
Remove authentication for a Azure DevOps organization.

This command removes the authentication configuration for an organization either specified
interactively or via `--organization`.

### Options


* `-o`, `--organization` `string`

The Azure DevOps organization to log out of


### Examples

```bash
$ azdo auth logout
# => select what organization to log out of via a prompt

$ azdo auth logout --hostname enterprise.internal
# => log out of specified organization
```

### See also

* [azdo auth](./azdo_auth)
37 changes: 37 additions & 0 deletions docs/azdo_auth_setup-git.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## azdo auth setup-git
```
azdo auth setup-git [flags]
```
This command configures git to use AzDO CLI as a credential helper.
For more information on git credential helpers please reference:
https://git-scm.com/docs/gitcredentials.

By default, AzDO CLI will be set as the credential helper for all authenticated organizations.
If there is no authenticated organization the command fails with an error.

Alternatively, use the `--organization` flag to specify a single organization to be configured.
If the organization is not authenticated with, the command fails with an error.

Be aware that a credential helper will only work with git remotes that use the HTTPS protocol.

### Options


* `-o`, `--organization` `string`

Configure git credential helper for specific organization


### Examples

```bash
# Configure git to use AzDO CLI as the credential helper for all authenticated organizations
$ azdo auth setup-git

# Configure git to use AzDO CLI as the credential helper for a specific organization
$ azdo auth setup-git --organization enterprise.internal
```

### See also

* [azdo auth](./azdo_auth)
20 changes: 20 additions & 0 deletions docs/azdo_auth_status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## azdo auth status
```
azdo auth status [flags]
```
Verifies and displays information about your authentication state.

This command will test your authentication state for each Azure DevOps organization that azdo knows about and
report any issues.

### Options


* `-o`, `--organization` `string`

Check a specific oragnizations&#39;s auth status


### See also

* [azdo auth](./azdo_auth)
20 changes: 20 additions & 0 deletions docs/azdo_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## azdo config
Display or change configuration settings for azdo.

Current respected settings:
- git_protocol: the protocol to use for git clone and push operations (default: "https")
- editor: the text editor program to use for authoring text
- prompt: toggle interactive prompting in the terminal (default: "enabled")
- pager: the terminal pager program to send standard output to
- http_unix_socket: the path to a Unix socket through which to make an HTTP connection
- browser: the web browser to use for opening URLs
- default_organization: the default Azure DevOps organization to use, if no organization is specified

### Available commands
* [azdo config get](./azdo_config_get)
* [azdo config list](./azdo_config_list)
* [azdo config set](./azdo_config_set)

### See also

* [azdo](./azdo)
24 changes: 24 additions & 0 deletions docs/azdo_config_get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## azdo config get
Print the value of a given configuration key
```
azdo config get <key> [flags]
```
### Options


* `-o`, `--organization` `string`

Get per-organization setting


### Examples

```bash

$ azdo config get git_protocol
https
```

### See also

* [azdo config](./azdo_config)
16 changes: 16 additions & 0 deletions docs/azdo_config_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## azdo config list
Print a list of configuration keys and values
```
azdo config list [flags]
```
### Options


* `-o`, `--organization` `string`

Get per-organization configuration


### See also

* [azdo config](./azdo_config)
25 changes: 25 additions & 0 deletions docs/azdo_config_set.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## azdo config set
Update configuration with a value for the given key
```
azdo config set <key> <value> [flags]
```
### Options


* `-o`, `--organization` `string`

Set per-organization setting


### Examples

```bash
$ azdo config set editor vim
$ azdo config set editor "code --wait"
$ azdo config set git_protocol ssh --organization myorg
$ azdo config set prompt disabled
```

### See also

* [azdo config](./azdo_config)
9 changes: 9 additions & 0 deletions docs/azdo_help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## azdo help
```
azdo help [command]
```
Help provides help for any command in the application.
Simply type azdo help [path to command] for full details.
### See also

* [azdo](./azdo)
Loading