@typeship-ax/cli 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +13 -9
- package/README.md +14 -27
- package/api.json +8898 -9026
- package/api.md +370 -328
- package/dist/arguments.d.ts +54 -0
- package/dist/arguments.d.ts.map +1 -0
- package/dist/arguments.js +265 -0
- package/dist/cli-agent.d.ts +73 -9
- package/dist/cli-agent.d.ts.map +1 -1
- package/dist/cli-agent.js +331 -44
- package/dist/cli.js +802 -291
- package/dist/core/http.d.ts +162 -19
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +381 -48
- package/dist/core/pagination.d.ts +42 -6
- package/dist/core/pagination.d.ts.map +1 -1
- package/dist/core/pagination.js +111 -17
- package/dist/credential-storage.d.ts +10 -3
- package/dist/credential-storage.d.ts.map +1 -1
- package/dist/credential-storage.js +15 -6
- package/dist/dates.d.ts +1 -1
- package/dist/dates.js +1 -1
- package/dist/errors.d.ts +20 -84
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +20 -108
- package/dist/fields.d.ts +36 -0
- package/dist/fields.d.ts.map +1 -0
- package/dist/fields.js +187 -0
- package/dist/index.d.ts +28 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -25
- package/dist/named-credentials.d.ts +19 -0
- package/dist/named-credentials.d.ts.map +1 -1
- package/dist/named-credentials.js +81 -1
- package/dist/oauth-login.d.ts +8 -2
- package/dist/oauth-login.d.ts.map +1 -1
- package/dist/oauth-login.js +31 -19
- package/dist/oauth-request.d.ts +7 -1
- package/dist/oauth-request.d.ts.map +1 -1
- package/dist/oauth-request.js +26 -4
- package/dist/oauth-session.d.ts +13 -1
- package/dist/oauth-session.d.ts.map +1 -1
- package/dist/oauth-session.js +34 -18
- package/dist/ops.d.ts +58 -5
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +110 -41
- package/dist/polling-login.d.ts +8 -2
- package/dist/polling-login.d.ts.map +1 -1
- package/dist/polling-login.js +25 -11
- package/dist/resources/api-keys.d.ts +10 -7
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +10 -31
- package/dist/resources/deliveries.d.ts +89 -5
- package/dist/resources/deliveries.d.ts.map +1 -1
- package/dist/resources/deliveries.js +96 -19
- package/dist/resources/drafts.d.ts +16 -16
- package/dist/resources/drafts.d.ts.map +1 -1
- package/dist/resources/drafts.js +12 -65
- package/dist/resources/files.d.ts +4 -4
- package/dist/resources/files.d.ts.map +1 -1
- package/dist/resources/files.js +3 -12
- package/dist/resources/generations.d.ts +16 -16
- package/dist/resources/generations.d.ts.map +1 -1
- package/dist/resources/generations.js +23 -47
- package/dist/resources/organization.d.ts +4 -4
- package/dist/resources/organization.d.ts.map +1 -1
- package/dist/resources/organization.js +3 -10
- package/dist/resources/{generate.d.ts → packages.d.ts} +16 -16
- package/dist/resources/packages.d.ts.map +1 -0
- package/dist/resources/{generate.js → packages.js} +13 -29
- package/dist/resources/projects.d.ts +50 -50
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +60 -116
- package/dist/resources/releases.d.ts +22 -17
- package/dist/resources/releases.d.ts.map +1 -1
- package/dist/resources/releases.js +19 -40
- package/dist/resources/spec-revisions.d.ts +16 -7
- package/dist/resources/spec-revisions.d.ts.map +1 -1
- package/dist/resources/spec-revisions.js +7 -29
- package/dist/resources/specs.d.ts +7 -7
- package/dist/resources/specs.d.ts.map +1 -1
- package/dist/resources/specs.js +6 -34
- package/dist/resources/targets.d.ts +49 -49
- package/dist/resources/targets.d.ts.map +1 -1
- package/dist/resources/targets.js +59 -115
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +83 -81
- package/dist/search.d.ts +54 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +421 -0
- package/dist/table.d.ts +28 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +167 -0
- package/dist/type-docs.d.ts +61 -0
- package/dist/type-docs.d.ts.map +1 -0
- package/dist/type-docs.js +174 -0
- package/dist/types.d.ts +499 -339
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +18 -18
- package/package.json +5 -2
- package/src/arguments.ts +254 -0
- package/src/cli-agent.ts +351 -46
- package/src/cli.ts +753 -266
- package/src/core/http.ts +457 -58
- package/src/core/pagination.ts +129 -18
- package/src/credential-storage.ts +16 -6
- package/src/dates.ts +1 -1
- package/src/errors.ts +46 -115
- package/src/fields.ts +167 -0
- package/src/index.ts +45 -28
- package/src/named-credentials.ts +66 -1
- package/src/oauth-login.ts +36 -21
- package/src/oauth-request.ts +32 -6
- package/src/oauth-session.ts +37 -19
- package/src/ops.ts +146 -45
- package/src/polling-login.ts +24 -11
- package/src/resources/api-keys.ts +34 -48
- package/src/resources/deliveries.ts +213 -32
- package/src/resources/drafts.ts +62 -109
- package/src/resources/files.ts +19 -20
- package/src/resources/generations.ts +61 -79
- package/src/resources/organization.ts +11 -16
- package/src/resources/{generate.ts → packages.ts} +43 -51
- package/src/resources/projects.ts +145 -200
- package/src/resources/releases.ts +50 -67
- package/src/resources/spec-revisions.ts +40 -49
- package/src/resources/specs.ts +39 -59
- package/src/resources/targets.ts +144 -194
- package/src/schemas.ts +83 -81
- package/src/search.ts +434 -0
- package/src/table.ts +167 -0
- package/src/type-docs.ts +205 -0
- package/src/types.ts +538 -357
- package/dist/console-login-check.d.ts +0 -21
- package/dist/console-login-check.d.ts.map +0 -1
- package/dist/console-login-check.js +0 -107
- package/dist/console-login-contract.d.ts +0 -45
- package/dist/console-login-contract.d.ts.map +0 -1
- package/dist/console-login-contract.js +0 -40
- package/dist/resources/generate.d.ts.map +0 -1
- package/dist/resources/publications.d.ts +0 -47
- package/dist/resources/publications.d.ts.map +0 -1
- package/dist/resources/publications.js +0 -70
- package/src/console-login-check.ts +0 -88
- package/src/console-login-contract.ts +0 -65
- package/src/resources/publications.ts +0 -140
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Typeship: agent guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Instructions for coding agents that call the Typeship API through this CLI (API version 1.0.0, package version 0.24.0).
|
|
4
4
|
|
|
5
5
|
Resolve an OpenAPI or GraphQL Spec, diagnose it, and keep every
|
|
6
6
|
selected CLI, MCP, and SDK Target current.
|
|
@@ -16,12 +16,10 @@ Examples use Parcel, a fictional delivery service. Replace its domains,
|
|
|
16
16
|
repository names, and resource identifiers with your own. The hosted
|
|
17
17
|
petstore Spec is a runnable sample.
|
|
18
18
|
|
|
19
|
-
##
|
|
20
|
-
-
|
|
21
|
-
-
|
|
19
|
+
## Before writing code
|
|
20
|
+
- `api.md` is the command and flag reference; `api.json` is the machine-readable contract: every operation's inputs, outputs, errors, `safety` (`read`, `write`, or `destructive`), and an example. Look up exact names there instead of guessing.
|
|
21
|
+
- `README.md` covers installation and setup.
|
|
22
22
|
- Zero runtime dependencies; the program runs on Node.js 20+ and platform `fetch`.
|
|
23
|
-
- `api.md` is the command and flag reference; `api.json` is the machine-readable operation, schema, safety, and example contract. Read them before guessing.
|
|
24
|
-
- Start with the local build or installation instructions in `README.md`. Generation does not publish a registry package.
|
|
25
23
|
|
|
26
24
|
## Authentication
|
|
27
25
|
- Bearer token: set the `TYPESHIP_TOKEN` environment variable.
|
|
@@ -29,8 +27,14 @@ petstore Spec is a runnable sample.
|
|
|
29
27
|
## Using the CLI
|
|
30
28
|
- `typeship <resource> <command>` calls an API operation; `typeship docs search <term> --json` finds operations and guides as structured data; `typeship docs <resource> <command>` gives a concise contract and example (add `--schema` for full schemas or `--json` for the machine contract).
|
|
31
29
|
- Path parameters are positional; other inputs are flags. JSON goes to stdout and exit codes are 0/1/2. Errors are one JSON envelope on stderr: `{status, issues: [{code, message}], next_steps, detail}`; branch on `issues[].code`. Every operation classified as destructive requires `--force` (or `--yes`).
|
|
32
|
-
- `typeship agent-guide --format json` explains the conventions; `typeship help --json`
|
|
30
|
+
- `typeship agent-guide --format json` explains the conventions; `typeship help --json` indexes the commands and `typeship help <resource> <command> --json` gives one command's flags; `typeship doctor` checks the setup. Read `typeship init --help` before setup: it can store credentials and update agent instructions. Choose the scope the task requires.
|
|
31
|
+
|
|
32
|
+
## Safety
|
|
33
|
+
- Read credentials from the environment or a secret store. Never hard-code them, print them, or put them in URLs or command arguments.
|
|
34
|
+
- Check an operation's `safety` in `api.json` before calling it. Confirm with the user before running a `write` or `destructive` operation they did not ask for.
|
|
35
|
+
- Destructive commands stop for confirmation unless `--force` (or `--yes`) is passed. Pass it only when the user asked for that change.
|
|
36
|
+
- Keep results small: select only the fields you need with `--fields` (CLI).
|
|
33
37
|
|
|
34
38
|
## Documentation
|
|
35
39
|
- The reference for this exact package: `api.md` (offline, always current with the code).
|
|
36
|
-
- Conceptual guides live on the docs site. For questions about how the API's concepts fit together (flows, ordering, environments), fetch `https://typeship.dev/llms-full.txt` and read the relevant sections; `https://typeship.dev/llms.txt` is the page index. Relative links in the spec resolve against `https://typeship.dev`.
|
|
40
|
+
- Conceptual guides live on the docs site. For questions about how the API's concepts fit together (flows, ordering, environments), fetch `https://typeship.dev/llms-full.txt` and read the relevant sections; `https://typeship.dev/llms.txt` is the page index. Relative links in the spec resolve against `https://typeship.dev/docs`.
|
package/README.md
CHANGED
|
@@ -1,45 +1,28 @@
|
|
|
1
1
|
# @typeship-ax/cli
|
|
2
2
|
|
|
3
|
-
CLI for
|
|
3
|
+
CLI for the Typeship API. [API reference](./api.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Resolve an OpenAPI or GraphQL Spec, diagnose it, and keep every selected CLI, MCP, and SDK Target current.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Spec-native CLI** — every operation is a command with typed flags, stable JSON, help, and exit codes
|
|
9
|
-
|
|
10
|
-
## Build from source
|
|
11
|
-
|
|
12
|
-
Run these commands in the downloaded or cloned package directory:
|
|
7
|
+
## Installation
|
|
13
8
|
|
|
14
9
|
```sh
|
|
15
|
-
npm install
|
|
16
|
-
npm run build
|
|
17
|
-
node dist/cli.js --help
|
|
10
|
+
npm install --global @typeship-ax/cli@0.24.0
|
|
18
11
|
```
|
|
19
12
|
|
|
20
|
-
Requires Node.js 20+.
|
|
21
|
-
|
|
22
|
-
## Install a published package
|
|
23
|
-
|
|
24
|
-
Generation does not publish a package. Before using the registry command below, confirm `name` and `version` in `package.json`, publish under a name you control, and verify that release is available on npm.
|
|
25
|
-
|
|
26
|
-
```sh
|
|
27
|
-
npm install --global @typeship-ax/cli@0.22.0
|
|
28
|
-
```
|
|
13
|
+
Requires Node.js 20+.
|
|
29
14
|
|
|
30
|
-
##
|
|
15
|
+
## Usage
|
|
31
16
|
|
|
32
17
|
The package ships `typeship`, a command for every API operation. API commands write JSON to stdout; discovery commands offer `--json`. Exit codes 0/1/2 mean success, request failure, and invalid usage.
|
|
33
18
|
|
|
34
19
|
```sh
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
typeship login # stores a credential (or set TYPESHIP_TOKEN)
|
|
21
|
+
typeship organization get
|
|
22
|
+
typeship projects list --all # every page, one item per line
|
|
23
|
+
typeship help --json # resources and command names; help <resource> <command> --json adds flags
|
|
39
24
|
```
|
|
40
25
|
|
|
41
|
-
These examples run from the package directory. After a global installation, use `typeship` in place of `node dist/cli.js`.
|
|
42
|
-
|
|
43
26
|
CLI conventions:
|
|
44
27
|
|
|
45
28
|
- Path parameters are positional; query and body fields are flags named after their wire fields.
|
|
@@ -49,9 +32,13 @@ CLI conventions:
|
|
|
49
32
|
|
|
50
33
|
Auth: `typeship login` stores a credential under `~/.config/typeship/profiles/default/`; the environment (`TYPESHIP_TOKEN`) and flags (`--token`) win over it. `TYPESHIP_BASE_URL` / `--base-url` pick the endpoint.
|
|
51
34
|
|
|
35
|
+
Headers the spec does not declare: `--header "Name: value"` (repeatable) or `TYPESHIP_HEADERS` (a JSON object, or one `Name: value` per line). They are sent on every request and replace any header of the same name the CLI would send.
|
|
36
|
+
|
|
52
37
|
Use `typeship login --profile work` for a separate login, `typeship auth use work` to select it, and `typeship auth profiles` to list profiles without exposing tokens. Selection follows `--profile`, then `TYPESHIP_PROFILE`, then the saved selection, then `default`. Profiles isolate saved settings and credentials; an API or environment change requires another login before using the saved credential.
|
|
53
38
|
|
|
54
39
|
Useful commands:
|
|
55
40
|
|
|
56
41
|
- `typeship init` configures credentials and repository agent instructions.
|
|
57
42
|
- `typeship docs search <term> --json`, `typeship doctor`, and `typeship help --json` cover discovery and diagnostics.
|
|
43
|
+
|
|
44
|
+
Generated from the OpenAPI spec by [Typeship](https://typeship.dev).
|