{"id":30237921,"url":"https://github.com/stainless-api/stainless-api-cli","last_synced_at":"2026-03-11T22:04:09.383Z","repository":{"id":295211435,"uuid":"959064526","full_name":"stainless-api/stainless-api-cli","owner":"stainless-api","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-05T21:52:09.000Z","size":1036,"stargazers_count":18,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-05T23:27:09.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stainless-api.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-02T07:59:22.000Z","updated_at":"2026-03-04T20:37:27.000Z","dependencies_parsed_at":"2025-07-17T10:56:31.882Z","dependency_job_id":"82a2d3fd-cff4-4d10-859a-525acef782aa","html_url":"https://github.com/stainless-api/stainless-api-cli","commit_stats":null,"previous_names":["stainless-api/stainless-api-cli"],"tags_count":78,"template":false,"template_full_name":null,"purl":"pkg:github/stainless-api/stainless-api-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-api%2Fstainless-api-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-api%2Fstainless-api-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-api%2Fstainless-api-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-api%2Fstainless-api-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stainless-api","download_url":"https://codeload.github.com/stainless-api/stainless-api-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-api%2Fstainless-api-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30404132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T21:51:19.558Z","status":"ssl_error","status_checked_at":"2026-03-11T21:50:57.892Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-15T02:57:55.174Z","updated_at":"2026-03-11T22:04:09.372Z","avatar_url":"https://github.com/stainless-api.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stainless CLI\n\n\u003e [!CAUTION]\n\u003e\n\u003e The CLI is unstable and the API may change. Please feel free to use it locally, but don't build scripts against it.\n\nThe official CLI for the [Stainless REST API](https://www.stainless.com/docs/getting-started/quickstart-cli).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n\u003c!-- x-release-please-start-version --\u003e\n\n## Installation\n\n### Installing with Homebrew\n\n```sh\nbrew install stainless-api/tap/stl\n```\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n```sh\ngo install 'github.com/stainless-api/stainless-api-cli/cmd/stl@latest'\n```\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n```sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n```\n\n\u003c!-- x-release-please-end --\u003e\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n```sh\n./scripts/run args...\n```\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n```sh\nstl [resource] \u003ccommand\u003e [flags...]\n```\n\n```sh\nstl builds create \\\n  --api-key 'My API Key' \\\n  --project stainless \\\n  --revision main\n```\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Required | Default value |\n| -------------------- | -------- | ------------- |\n| `STAINLESS_API_KEY`  | no       | `null`        |\n\n### Global flags\n\n- `--api-key` (can also be set with `STAINLESS_API_KEY` env var)\n- `--project`\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n```bash\nstl \u003ccommand\u003e --arg @abe.jpg\n```\n\nFiles can also be passed inside JSON or YAML blobs:\n\n```bash\nstl \u003ccommand\u003e --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nstl \u003ccommand\u003e \u003c\u003cYAML\narg:\n  image: \"@abe.jpg\"\nYAML\n```\n\nIf you need to pass a string literal that begins with an `@` sign, you can\nescape the `@` sign to avoid accidentally passing a file.\n\n```bash\nstl \u003ccommand\u003e --username '\\@abe'\n```\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n```bash\nstl \u003ccommand\u003e --arg @data://file.txt\n```\n## Workspace Configuration\n\nThe CLI supports workspace configuration to avoid repeatedly specifying the project name. When you run a command, the CLI will:\n\n1. Check if a project name is provided via command-line flag\n2. If not, look for a `.stainless/workspace.json` file in the current directory or any parent directory\n3. Use the project name from the workspace configuration if found\n\n### Initializing a Workspace\n\nYou can initialize a workspace configuration with:\n\n```sh\nstl workspace init --project your-project-name\n```\n\nIf you don't provide the `--project` flag, you'll be prompted to enter a project name.\n\nAdditionally, when you run a command with a project name flag in an interactive terminal, the CLI will offer to initialize a workspace configuration for you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstainless-api%2Fstainless-api-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstainless-api%2Fstainless-api-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstainless-api%2Fstainless-api-cli/lists"}