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
18 changes: 18 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ steps:
<cli> routine list --tree # Show full tree structure
<cli> routine run <name> # Execute a routine
<cli> routine run <name> --set key=value # Override variables
<cli> --config <env> routine run <name> # Run against another configured environment
<cli> routine run <name> --dry-run # Preview without executing
<cli> routine run <name> --json # Emit RoutineResult as JSON to stdout
<cli> routine run <name> -s / --quiet # Print only what the routine's commands print (failures still on stderr)
<cli> routine validate <name> # Validate YAML structure
<cli> routine test <name> # Run spec (test) file
<cli> routine init # Install built-in routines
Expand Down Expand Up @@ -135,6 +138,21 @@ apijack supports pluggable authentication:
| `routine validate <name>` | Validate routine YAML |
| `routine test <name>` | Run a routine's spec/test file |

### Running one command against another environment

A leading `--config <name>` runs a single invocation against any environment in `config.json`, without changing the active one:

```bash
<cli> --config staging admin matters delete 7
<cli> --config staging routine run cleanup --set matterId=2 # every step and sub-routine uses staging
```

- Uses that environment's URL, credentials, auth type, `sessionAuth` / `refreshOn` and its own session file. It wins over `<CLI>_URL` / `_USER` / `_PASS`.
- It goes before the command; `--config=<name>` works too. A `--config` after the command belongs to that command (e.g. a generated flag for an API field named `config`); a command without one rejects it with a hint to move it.
- An unknown name fails with the list of configured environments.
- `<cli> --config <name> mcp` passes the environment on to every CLI call the MCP server makes.
- Programmatic: `runRoutine(name, { config: '<name>' })`, or `createCli({ environment: '<name>', ... })` (a leading `--config` still wins).

## MCP Server

Run `<cli> mcp` to start a Model Context Protocol server, exposing all CLI commands as MCP tools for use with AI agents and editors.
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ Each environment in `config.json` keeps its own cached session at `<configDir>/s

- `config switch <name>` keeps every environment's session, so switching away and back doesn't log you out.
- Saving an environment's credentials (`setup` / `login`, `config import`, `config update-password`, the MCP `setup` tool) clears that environment's session, so the next command logs in with the new credentials. Re-running `setup` with unchanged credentials costs one extra login.
- Editing credentials in `config.json` by hand bypasses that. A changed `url` or `user` is still caught, but a changed `password` isn't, so run `config clear-session` afterwards.
- `config clear-session [name]` deletes the active (or named) environment's session; `--all` deletes them all.
- `routine run` reuses the environment's cached session like any other command. Programmatic `cli.runRoutine()` / `runRoutine()` still clear it before running, so fixtures start from a fresh login.
- Creating `sessions/` also writes `sessions/.gitignore` containing `*`, so session tokens stay out of git even in projects that only ignore the old `.apijack/session.json`. The directory is created owner-only (`0700`) and session files are written `0600`.
Expand Down
18 changes: 18 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ steps:
<cli> routine list --tree # Show full tree structure
<cli> routine run <name> # Execute a routine
<cli> routine run <name> --set key=value # Override variables
<cli> --config <env> routine run <name> # Run against another configured environment
<cli> routine run <name> --dry-run # Preview without executing
<cli> routine run <name> --json # Emit RoutineResult as JSON to stdout
<cli> routine run <name> -s / --quiet # Print only what the routine's commands print (failures still on stderr)
<cli> routine validate <name> # Validate YAML structure
<cli> routine test <name> # Run spec (test) file
<cli> routine init # Install built-in routines
Expand Down Expand Up @@ -135,6 +138,21 @@ apijack supports pluggable authentication:
| `routine validate <name>` | Validate routine YAML |
| `routine test <name>` | Run a routine's spec/test file |

### Running one command against another environment

A leading `--config <name>` runs a single invocation against any environment in `config.json`, without changing the active one:

```bash
<cli> --config staging admin matters delete 7
<cli> --config staging routine run cleanup --set matterId=2 # every step and sub-routine uses staging
```

- Uses that environment's URL, credentials, auth type, `sessionAuth` / `refreshOn` and its own session file. It wins over `<CLI>_URL` / `_USER` / `_PASS`.
- It goes before the command; `--config=<name>` works too. A `--config` after the command belongs to that command (e.g. a generated flag for an API field named `config`); a command without one rejects it with a hint to move it.
- An unknown name fails with the list of configured environments.
- `<cli> --config <name> mcp` passes the environment on to every CLI call the MCP server makes.
- Programmatic: `runRoutine(name, { config: '<name>' })`, or `createCli({ environment: '<name>', ... })` (a leading `--config` still wins).

## MCP Server

Run `<cli> mcp` to start a Model Context Protocol server, exposing all CLI commands as MCP tools for use with AI agents and editors.
Expand Down
1 change: 1 addition & 0 deletions skills/setup-api/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ apijack plugin config add-cidr 10.0.0.0/8
- **"No environments configured"** — run `apijack setup` or use the MCP `setup` tool
- **"Command map not available"** — run `apijack generate` after setup
- **"Production API detected"** — use env vars or add the network to allowed CIDRs
- **Edited `config.json` by hand** — run `apijack config clear-session` (or `apijack config clear-session <env>` for another environment) so the next command logs in with the new credentials
- **Auth failures after setup** — try `apijack config switch <env>` to verify active environment, `apijack config clear-session` to force a fresh login, then `apijack generate` to refresh
3 changes: 3 additions & 0 deletions skills/write-routine/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ Built-in commands available in routines:
```bash
<cli> routine run <name> # Execute
<cli> routine run <name> --set key=value # Override variables
<cli> --config <env> routine run <name> # Run against another configured environment
<cli> routine run <name> --dry-run # Preview without executing
<cli> routine run <name> --json # Emit RoutineResult as JSON to stdout
<cli> routine run <name> -s / --quiet # Print only what the routine's commands print (failures still on stderr)
<cli> routine validate <name> # Check YAML structure
<cli> routine test <name> # Run spec/test file
<cli> routine list # List available
Expand Down
Loading