Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
node_modules
**/dist
**/tmp
tmp
dst
packages/ci/src/interfaces/kolkrabbi.ts
4 changes: 2 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
'oclif-typescript',
'plugin:mocha/recommended',
],
ignorePatterns: ['**/test/**/*.js', '**/oldCommands/**/*', 'packages/*/lib/**'],
ignorePatterns: ['**/test/**/*.js', '**/oldCommands/**/*', 'dist/**'],

// TypeScript settings
overrides: [
Expand All @@ -18,7 +18,7 @@ module.exports = {
},
'import/resolver': {
typescript: {
project: 'packages/*/tsconfig.json',
project: 'tsconfig.json',
},
},
},
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ jobs:
cache: npm
- run: npm ci
- name: Run cli package integration tests
run: |
cd packages/cli
npm run test:integration
run: npm run test:integration

acceptance:
runs-on: ${{ matrix.os }}
Expand All @@ -67,11 +65,11 @@ jobs:
# on 'main' and 'release-' branches, these tests will be run as part of the acceptance tests.
- name: run smoke tests
if: github.ref_name != 'main' || !startsWith(github.ref_name, 'release-')
run: cd packages/cli && npm run test:smoke
run: npm run test:smoke
# only run the full suite of acceptance tests on 'main' and 'release-' branches
- name: run acceptance tests
if: github.ref_name == 'main' || startsWith(github.ref_name, 'release-')
run: cd packages/cli && npm run test:acceptance
run: npm run test:acceptance

spell-check:
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-cli-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- id: getVersion
uses: ./.github/actions/get-version-and-channel/
with:
path: './packages/cli/package.json'
path: './package.json'

publish-npm:
needs: [get-version-channel]
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/devcenter-doc-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ jobs:
- name: Build CLI
run: npm run build
- name: Compile documentation and push to devcenter
run: |
cd packages/cli
./scripts/postrelease/dev_center_docs
run: ./scripts/postrelease/dev_center_docs
env:
HEROKU_DEVCENTER_API_KEY: ${{ secrets.HEROKU_DEVCENTER_API_KEY }}
27 changes: 13 additions & 14 deletions .github/workflows/pack-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
- name: Install package deps
run: npm ci
- name: Create npm-shrinkwrap.json for oclif pack:deb
run: cd packages/cli && npm run create-shrinkwrap
run: npm run create-shrinkwrap
- name: Building deb
run: cd packages/cli && npx oclif pack:deb --root=.
run: npx oclif pack:deb
- uses: actions/upload-artifact@v6
with:
name: packed-deb
path: /home/runner/work/cli/cli/packages/cli/dist
path: /home/runner/work/cli/cli/dist

pack_tarballs:
runs-on: pub-hk-ubuntu-22.04-2xlarge
Expand All @@ -39,13 +39,13 @@ jobs:
- name: Install package deps
run: npm ci
- name: Create npm-shrinkwrap.json for oclif pack:tarballs
run: cd packages/cli && npm run create-shrinkwrap
run: npm run create-shrinkwrap
- name: Building tarballs
run: cd packages/cli && npx oclif pack:tarballs --root=. --xz --parallel
run: npx oclif pack:tarballs --xz --parallel
- uses: actions/upload-artifact@v6
with:
name: packed-tarballs
path: /home/runner/work/cli/cli/packages/cli/dist
path: /home/runner/work/cli/cli/dist

sign_deb:
needs: [pack_deb]
Expand All @@ -62,14 +62,14 @@ jobs:
- uses: actions/download-artifact@v7
with:
name: packed-deb
path: /home/runner/work/cli/cli/packages/cli/dist
path: /home/runner/work/cli/cli/dist
- run: |
cd /home/runner/work/cli/cli/packages/cli/dist/deb
/home/runner/work/cli/cli/packages/cli/scripts/sign/deb
cd /home/runner/work/cli/cli/dist/deb
/home/runner/work/cli/cli/scripts/sign/deb
- uses: actions/upload-artifact@v6
with:
name: signed-deb
path: /home/runner/work/cli/cli/packages/cli/dist
path: /home/runner/work/cli/cli/dist


upload-deb-and-tarballs:
Expand All @@ -86,20 +86,19 @@ jobs:
- uses: actions/download-artifact@v7
with:
name: signed-deb
path: /home/runner/work/cli/cli/packages/cli/dist
path: /home/runner/work/cli/cli/dist

- uses: actions/download-artifact@v7
with:
name: packed-tarballs
path: /home/runner/work/cli/cli/packages/cli/dist
path: /home/runner/work/cli/cli/dist
- name: List all the downloaded files (for debugging)
run: ls -R
working-directory: /home/runner/work/cli/cli/packages/cli/dist
working-directory: /home/runner/work/cli/cli/dist
- name: Install dependencies
run: npm ci
- name: Upload production artifacts
run: |
pwd
npm run upload:tarballs
cd packages/cli
./scripts/upload/deb
6 changes: 3 additions & 3 deletions .github/workflows/publish-to-fig-autocomplete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ jobs:
node-version: 22.x
cache: npm
- name: Install Fig Oclif Plugin
run: cd packages/cli && npm install @fig/complete-oclif && jq '.oclif.plugins += ["@fig/complete-oclif"]' package.json > temp.json && mv temp.json package.json
run: npm install @fig/complete-oclif && jq '.oclif.plugins += ["@fig/complete-oclif"]' package.json > temp.json && mv temp.json package.json
- run: npm ci
- name: Build Heroku CLI
run: npm run build
- name: Get Heroku Version
id: cli-version
run: echo "version=$(./bin/run --version | sed -rn 's/^heroku\/([0-9\.]+).*$/\1/p')" >> $GITHUB_OUTPUT
- name: Generate Fig Spec
run: cd packages/cli && ./bin/run generate-fig-spec > spec.ts
run: ./bin/run generate-fig-spec > spec.ts
- name: Create Fig Autocomplete PR
uses: withfig/push-to-fig-autocomplete-action@v2
with:
token: ${{ secrets.HEROKU_CLI_BOT_TOKEN }}
autocomplete-spec-name: 'heroku'
spec-path: ./packages/cli/spec.ts
spec-path: ./spec.ts
integration: oclif
diff-based-versioning: true
new-spec-version: ${{ steps.cli-version.outputs.version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/start-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- id: getVersion
uses: ./.github/actions/get-version-and-channel/
with:
path: './packages/cli/package.json'
path: './package.json'

validate-prerelease:
# validate that the release is on a pre-release branch, that it is a beta or alpha release, and check if it is already on github
Expand Down
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
*-debug.log
*-error.log
.oclif.manifest.json
/packages/**/oclif.manifest.json
oclif.manifest.json
/cli
/.nyc_output
/coverage
/dist
/lib
node_modules
/tmp
/packages/cli/docs/*

**/.DS_Store
.idea
.vscode
**/.nyc_output
**/coverage/
.pnp.*
npm-shrinkwrap.json

# Ignore .yarn directory from previous yarn setup
.yarn/
yarn.lock

# TEMP
/packages/**/converted/*
tpsGetLock_response.txt
tpsRecordRelease_response.txt
File renamed without changes.
8 changes: 4 additions & 4 deletions .versionrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"packageFiles": [
"packages/cli/package.json"
"package.json"
],
"bumpFiles": [
"packages/cli/package.json"
"package.json"
],
"infile": "packages/cli/CHANGELOG.md",
"infile": "CHANGELOG.md",
"header": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\n",
"types": [
{ "type": "feat", "section": "Features" },
Expand All @@ -26,6 +26,6 @@
"commit": true
},
"scripts": {
"postbump": "npm install --package-lock-only && cd packages/cli && npx oclif readme --multi && cd ../.. && git add package-lock.json packages/cli/README.md docs"
"postbump": "npm install --package-lock-only && npx oclif readme --multi && git add package-lock.json README.md docs"
}
}
1 change: 0 additions & 1 deletion README.md

This file was deleted.

111 changes: 111 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
Heroku CLI
==========

![Heroku logo](https://d4yt8xl9b7in.cloudfront.net/assets/home/logotype-heroku.png)
[![Node CI Suite](https://github.com/heroku/cli/actions/workflows/ci.yml/badge.svg)](https://github.com/heroku/cli/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/heroku.svg)](https://www.npmjs.com/package/heroku)
[![ISC License](https://img.shields.io/github/license/heroku/cli.svg)](https://github.com/heroku/cli/blob/main/LICENSE)

The Heroku CLI is used to manage Heroku apps from the command line. It is built using [oclif](https://oclif.io).

For more about Heroku see <https://www.heroku.com/home>

To get started see <https://devcenter.heroku.com/start>

Overview
========

The Heroku CLI is a command-line interface for managing Heroku applications and services. Built with Node.js and [oclif](https://oclif.io), it provides an extensible architecture for interacting with the Heroku platform.

Key features include:

- **App management** - Deploy, scale, and monitor your applications
- **Heroku Postgres database management** - Backup, restore, and manage Heroku Postgres databases
- **Heroku CI/CD pipelines** - Run automated tests and manage review apps for streamlined deployment workflows
- **Add-ons marketplace** - Provision and manage tools and services to extend your application
- **SSL certificates and domains** - Configure custom domains and automatically manage SSL/TLS certificates
- **Team collaboration** - Manage organization and team access with granular permissions
- **Private Spaces** - Deploy applications in network-isolated environments with VPN support
- **Logs and monitoring** - Stream application logs and forward them to external services
- **Plugin ecosystem** - Extend functionality with community and custom plugins

For more on developing plugins, read [Developing CLI Plugins](https://devcenter.heroku.com/articles/developing-cli-plugins)

Issues
======

For problems directly related to the CLI, [add an issue on GitHub](https://github.com/heroku/cli/issues/new).

For other issues, [submit a support ticket](https://help.heroku.com/).

[Contributors](https://github.com/heroku/cli/contributors)

<!-- commands -->
# Command Topics

* [`heroku access`](docs/access.md) - manage user access to apps
* [`heroku accounts`](docs/accounts.md) - list the Heroku accounts in your cache
* [`heroku addons`](docs/addons.md) - tools and services for developing, extending, and operating your app
* [`heroku ai`](docs/ai.md) - manage Heroku AI models
* [`heroku apps`](docs/apps.md) - manage apps on Heroku
* [`heroku auth`](docs/auth.md) - manage authentication for your Heroku account
* [`heroku authorizations`](docs/authorizations.md) - OAuth authorizations
* [`heroku buildpacks`](docs/buildpacks.md) - scripts used to compile apps
* [`heroku certs`](docs/certs.md) - SSL certificates
* [`heroku ci`](docs/ci.md) - test runner for Heroku Pipelines
* [`heroku clients`](docs/clients.md) - OAuth clients on the platform
* [`heroku config`](docs/config.md) - environment variables of apps
* [`heroku container`](docs/container.md) - deploy your Docker-based app to Heroku
* [`heroku domains`](docs/domains.md) - custom domains for apps
* [`heroku drains`](docs/drains.md) - forward logs to syslog or HTTPS
* [`heroku features`](docs/features.md) - add/remove app features
* [`heroku git`](docs/git.md) - set git remote and clone Heroku repository
* [`heroku help`](docs/help.md) - Display help for heroku.
* [`heroku keys`](docs/keys.md) - add/remove account ssh keys
* [`heroku labs`](docs/labs.md) - add/remove experimental features
* [`heroku logs`](docs/logs.md) - display recent log output
* [`heroku maintenance`](docs/maintenance.md) - enable/disable access to app
* [`heroku notifications`](docs/notifications.md) - display notifications
* [`heroku orgs`](docs/orgs.md) - manage organizations
* [`heroku plugins`](docs/plugins.md) - List installed plugins.
* [`heroku ps`](docs/ps.md) - Client tools for Heroku Exec
* [`heroku regions`](docs/regions.md) - list available regions for deployment
* [`heroku reviewapps`](docs/reviewapps.md) - manage reviewapps in pipelines
* [`heroku sessions`](docs/sessions.md) - OAuth sessions
* [`heroku status`](docs/status.md) - display current status of the Heroku platform
* [`heroku teams`](docs/teams.md) - manage teams
* [`heroku telemetry`](docs/telemetry.md) - list telemetry drains
* [`heroku update`](docs/update.md) - update the Heroku CLI
* [`heroku usage`](docs/usage.md) - list usage for metered add-ons attached to an app or apps within a team
* [`heroku version`](docs/version.md)

<!-- commandsstop -->

Developing
==========

This project is built with [lerna](https://lerna.js.org/). The core plugins are located in [./packages](./packages).

After cloning the repo
1. Run `npm install` to install dependencies
2. Run `npm run build` to build the CLI. This will need to be re-run any time you make changes and want to test them locally.

To execute Heroku CLI commands locally, use `./bin/run <command>`. For example, to run the `heroku apps` command with your local code, run `./bin/run apps` from the root directory.

Testing
=======

Run all tests with `npm test`.

## Debugging

Using WebStorm (from JetBrains / IntelliJ), you can run/debug an individual test case.

- Create a new run/debug configuration
- Select the 'Mocha' type

Releasing
=========
See the [Heroku CLI Release Steps](https://salesforce.quip.com/aPLDA1ZwjNlW).

Review our [PR guidelines](./.github/PULL_REQUEST_TEMPLATE.md).
File renamed without changes
1 change: 0 additions & 1 deletion bin

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/cli/bin/run → bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable node/shebang */

import {execute} from '@oclif/core'
import * as globalTelemetry from '../lib/global_telemetry.js'
import * as globalTelemetry from '../dist/global_telemetry.js'

process.env.HEROKU_UPDATE_INSTRUCTIONS = process.env.HEROKU_UPDATE_INSTRUCTIONS || 'update with: "npm update -g heroku"'

Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
}
],
"ignorePaths": [
"./cspell-dictionary.txt",
"./packages/cli/CHANGELOG.md",
"./CHANGELOG.md",
"./cspell-dictionary.txt",
"./CHANGELOG.md",
"**/package-lock.json",
"**/node_modules/**",
"**/coverage/**"
Expand Down
14 changes: 0 additions & 14 deletions lerna.json

This file was deleted.

1 change: 1 addition & 0 deletions packages/cli/nyc-config.js → nyc-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
'**/*.test.ts',
'**/*.spec.ts',
'test/**/*',
'dist/**/*',
'lib/**/*',
'coverage/**',
'.nyc_output/**',
Expand Down
Loading
Loading