diff --git a/README.md b/README.md index 47d293f..d8552c0 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/VERSION b/VERSION index 82942c3..fad30c5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.1.6 +v0.1.7 diff --git a/internal/craken/command.go b/internal/craken/command.go index e4ff954..d246818 100644 --- a/internal/craken/command.go +++ b/internal/craken/command.go @@ -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] diff --git a/internal/craken/command_test.go b/internal/craken/command_test.go index fc88afa..b5b89c7 100644 --- a/internal/craken/command_test.go +++ b/internal/craken/command_test.go @@ -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{{ @@ -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) @@ -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", } {