Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NITRO CLI Documentation #7762

Merged
merged 8 commits into from
Dec 1, 2024
9 changes: 9 additions & 0 deletions website/src/docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@
{
"path": "authentication",
"title": "Authentication"
},
{
"path": "global-options",
"title": "Global Options"
},
{
"path": "automation",
"title": "Automation"
}
]
},
Expand All @@ -114,6 +122,7 @@
{ "path": "launch", "title": "launch" },
{ "path": "login", "title": "login" },
{ "path": "logout", "title": "logout" },
{ "path": "pat", "title": "pat" },
{ "path": "schema", "title": "schema" },
{ "path": "stage", "title": "stage" },
{
Expand Down
42 changes: 36 additions & 6 deletions website/src/docs/nitro/cli-commands/api-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,29 @@ title: API Key Management

The `nitro api-key` command provides a set of subcommands that allow you to manage API keys.

# Create a Key
# Create an API Key

The `nitro api-key create` command is used to create a new API key.

> **Important:** Use the value prefixed with `Secret:` as the api key value you pass to `ChilliCream.Nitro`
> **Important:** Use the value prefixed with `Secret:` as the API key value you pass to `nitro`.

```shell
nitro api-key create --api-id abc123
nitro api-key create --name "My API Key" --api-id abc123
```

**Options**

- `--api-id <api-id>`: Specifies the ID of the API for which you want to create a new API key. This ID can be retrieved with the `nitro api list` command. You can set it from the environment variable `NITRO_API_ID`.
- `--name <name>`: Specifies a name for the API key for future reference. You can set it from the environment variable `NITRO_API_KEY_NAME`.
- `--api-id <api-id>`: Specifies the ID of the API for which you want to create the API key. This ID can be retrieved with the `nitro api list` command. You can set it from the environment variable `NITRO_API_ID`.
- `--workspace-id <workspace-id>`: Specifies the ID of the workspace. If not provided, the default workspace is used. You can set it from the environment variable `NITRO_WORKSPACE_ID`.

# Delete a Key
**Global Options**

- `--cloud-url <cloud-url>`
- `--api-key <api-key>`
- `--output <json>`

# Delete an API Key

The `nitro api-key delete` command is used to delete an API key by its ID.

Expand All @@ -30,10 +38,32 @@ nitro api-key delete api-key123

- `<id>`: Specifies the ID of the API key you want to delete.

# List all Keys
**Options**

- `--force`: If provided, the command will not ask for confirmation before deleting.

**Global Options**

- `--cloud-url <cloud-url>`
- `--api-key <api-key>`
- `--output <json>`

# List All API Keys

The `nitro api-key list` command is used to list all API keys of a workspace.

```shell
nitro api-key list
```

**Options**

- `--cursor <cursor>`: Specifies the cursor to start the query (for pagination). Useful in non-interactive mode. You can set it from the environment variable `NITRO_CURSOR`.
- `--workspace-id <workspace-id>`: Specifies the ID of the workspace. If not provided, the default workspace is used. You can set it from the environment variable `NITRO_WORKSPACE_ID`.

**Global Options**

- `--cloud-url <cloud-url>`
- `--api-key <api-key>`
- `--output <json>`

63 changes: 47 additions & 16 deletions website/src/docs/nitro/cli-commands/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,21 @@ The `nitro api` command provides a set of subcommands that allow you to manage A
The `nitro api create` command is used to create a new API.

```shell
nitro api create
nitro api create --name "My API" --path "/my-api"
```

**Options**

- `--name <name>`: Specifies the name of the API. You can set it from the environment variable `NITRO_API_NAME`.
- `--path <path>`: Specifies the path to the API. You can set it from the environment variable `NITRO_API_PATH`.
- `--workspace-id <workspace-id>`: Specifies the ID of the workspace. If not provided, the default workspace is used. You can set it from the environment variable `NITRO_WORKSPACE_ID`.

**Global Options**

- `--cloud-url <cloud-url>`
- `--api-key <api-key>`
- `--output <json>`

# Delete an API

The `nitro api delete` command is used to delete an API by its ID.
Expand All @@ -20,18 +32,43 @@ The `nitro api delete` command is used to delete an API by its ID.
nitro api delete abc123
```

**Arguments:**
**Arguments**

- `<id>`: Specifies the ID of the API you want to delete.

# List all APIs
**Options**

The `nitro api list` command is used to list all APIs of a workspace.
- `--force`: If provided, the command will not ask for confirmation before deleting.

**Global Options**

- `--cloud-url <cloud-url>`
- `--api-key <api-key>`
- `--output <json>`

# Set API Settings

The `nitro api set-settings` command is used to set the settings of an API.

```shell
nitro api list
nitro api set-settings abc123 --treat-dangerous-as-breaking --allow-breaking-schema-changes
```

**Arguments**

- `<id>`: Specifies the ID of the API whose settings you want to set.

**Options**

- `--treat-dangerous-as-breaking`: If provided, dangerous changes will be treated as breaking changes. You can set it from the environment variable `NITRO_TREAT_DANGEROUS_AS_BREAKING`.
- `--allow-breaking-schema-changes`: If provided, allows breaking schema changes when no client breaks. You can set it from the environment variable `NITRO_ALLOW_BREAKING_SCHEMA_CHANGES`.

**Global Options**

- `--cloud-url <cloud-url>`
- `--api-key <api-key>`
- `--output <json>`

# Show API Details

The `nitro api show` command is used to show the details of an API.
Expand All @@ -40,18 +77,12 @@ The `nitro api show` command is used to show the details of an API.
nitro api show abc123
```

**Arguments:**
**Arguments**

- `<id>`: Specifies the ID of the API whose details you want to see.

# Set API Settings

The `nitro api set-settings` command is used to set the settings of an API.

```shell
nitro api set-settings abc123
```

**Arguments:**
**Global Options**

- `<id>`: Specifies the ID of the API whose settings you want to set.
- `--cloud-url <cloud-url>`
- `--api-key <api-key>`
- `--output <json>`
Loading
Loading