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
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ go build -o bin/craken ./cmd/craken
## Login

```sh
craken auth login --profile ak
craken auth login
```

The login command prints a short code and opens the normal Craken browser session flow. Confirm the same code in the browser; the waiting CLI polls the server and stores the approved bearer credential in the selected profile. Use `--no-open` when the browser is on another machine, such as an SSH session.
The login command prints a short code and opens the normal Craken browser session flow. Confirm the same code in the browser; the waiting CLI polls the server and stores the approved bearer credential in the selected profile, which defaults to `default`. Use `--no-open` when the browser is on another machine, such as an SSH session.

## Usage

```sh
craken workspace list --profile ak
craken workspace create --profile ak --name test0
craken channel send --profile ak --workspace test0 --channel general hello
craken dm send --profile ak --workspace test0 --target orca hello
craken workspace tail --profile ak --workspace test0 --pretty
craken commands --profile ak --format text
craken do workspaces.list --profile ak
craken workspace list
craken workspace create --name test0
craken channel send --workspace test0 --channel general hello
craken dm send --workspace test0 --target orca hello
craken workspace tail --workspace test0 --pretty
craken commands --format text
craken do workspaces.list
```

Profiles live in `${CRAKEN_CONFIG_DIR:-~/.config/craken}/config.json`.
Profiles live in `${CRAKEN_CONFIG_DIR:-~/.config/craken}/config.json`. Use `--profile NAME` or `CRAKEN_PROFILE` only when you need more than one profile.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.1.6
v0.1.7
6 changes: 3 additions & 3 deletions internal/craken/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ func printCatalogHelp(stdout io.Writer, catalog clientCatalog) error {
if _, err := fmt.Fprint(stdout, `Craken CLI

Authentication:
craken auth login --profile PROFILE
craken auth import-token --profile PROFILE --token -
craken auth login
craken auth import-token --token -

Catalog commands:
craken commands --profile PROFILE --format text
craken commands --format text
craken do OPERATION_ID [options]
craken get|post|put|patch|delete PATH [options]

Expand Down
6 changes: 5 additions & 1 deletion internal/craken/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestHelpRendersServerCatalogWithOptionalBearer(t *testing.T) {
"operationId": "custom.operation",
}},
"examples": []map[string]any{{
"command": "craken do custom.operation --profile PROFILE",
"command": "craken do custom.operation",
"description": "Run the server-provided example",
}},
"routes": []map[string]any{{
Expand Down Expand Up @@ -92,6 +92,8 @@ func TestHelpRendersServerCatalogWithOptionalBearer(t *testing.T) {
"e.g. craken custom run --name demo",
"custom.operation\tPOST\t/api/custom\tRun a custom operation",
"craken do OPERATION_ID",
"craken auth login",
"craken commands --format text",
} {
if !strings.Contains(help, expected) {
t.Fatalf("expected help to contain %q, got:\n%s", expected, help)
Expand All @@ -103,6 +105,8 @@ func TestHelpRendersServerCatalogWithOptionalBearer(t *testing.T) {
for _, stale := range []string{
"Server-advertised shortcuts:",
"custom run|inspect",
"craken auth login --profile PROFILE",
"craken commands --profile PROFILE --format text",
"workspace list|get|create|delete",
"workspace|channel|dm|file|folder|wiki|agent|dream",
} {
Expand Down