https://github.com/heroku/heroku-cli-command
https://github.com/heroku/heroku-cli-command
cli-engine heroku-cli
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/heroku/heroku-cli-command
- Owner: heroku
- License: apache-2.0
- Created: 2017-05-17T17:49:02.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2025-09-30T19:46:47.000Z (3 months ago)
- Last Synced: 2025-09-30T20:29:29.494Z (3 months ago)
- Topics: cli-engine, heroku-cli
- Language: TypeScript
- Size: 1.7 MB
- Stars: 19
- Watchers: 88
- Forks: 23
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
Heroku CLI Command
===================
Base class for Heroku CLI commands. Built off of [oclif](https://oclif.io).
[](https://npmjs.org/package/@heroku-cli/command)

[](https://snyk.io/test/npm/@heroku-cli/command)
[](https://npmjs.org/package/@heroku-cli/command)
[](https://github.com/heroku/heroku-cli-command/blob/master/package.json)
## Overview
This package provides the core functionality for Heroku CLI commands, including a comprehensive set of completion handlers for various Heroku resources. It serves as the foundation for building Heroku CLI commands with built-in support for command-line completion.
## Features
### Completion Handlers
The package includes completion handlers for various Heroku resources:
- **Apps**: Autocomplete for Heroku application names
- **Addons**: Autocomplete for add-ons associated with specific apps
- **Dynos**: Autocomplete for dyno names within apps
- **Buildpacks**: Common Heroku buildpack options
- **Dyno Sizes**: Available dyno size options
- **Files**: Local file system completion
- **Pipelines**: Heroku pipeline names
- **Process Types**: Process types from Procfile
- **Regions**: Available Heroku regions
- **Git Remotes**: Git remote names
- **Roles**: User role options (admin, collaborator, member, owner)
- **Scopes**: Permission scope options
- **Spaces**: Heroku Private Spaces
- **Stacks**: Available Heroku stacks
- **Stages**: Pipeline stage options
- **Teams**: Heroku team names
### APIClient
The package includes a built-in `APIClient` for making authenticated requests to the Heroku Platform API:
- Handles authentication and request formatting
- Provides a simple interface for making GET requests to Heroku resources
- Automatically parses JSON responses
- Used internally by completion handlers to fetch resource lists
- Supports configurable request options through the CLI config
Example usage:
```typescript
const heroku = new APIClient(config)
const {body: resources} = await heroku.get('/apps')
```
## Usage
This package is primarily used as a dependency in other Heroku CLI plugins and commands. It provides the base functionality needed to implement Heroku CLI commands with proper completion support.
## Development
Built with TypeScript and uses the [oclif](https://oclif.io) framework for CLI command development.