Skip to main content

Overview

The Corelayer CLI gives you terminal access to Corelayer groups, issues, and integrations. Sign in from your browser, then use Corelayer from the terminal. If your organization uses a dedicated Corelayer deployment, the CLI connects to the right server automatically.

Prerequisites

  • Node.js 18+
  • npm
  • A Corelayer account with access to at least one organization

Install

npm install -g @corelayer-ai/cli
corelayer --version

Authenticate

Browser Login

corelayer login
This flow:
  1. Opens the Corelayer app in your browser
  2. Asks you to authorize CLI access for your current organization
  3. Redirects back to a temporary localhost callback used by the CLI
  4. Stores your API key and server URL in ~/.corelayer/config.json

Manual Login

Use manual login when the browser cannot open, the localhost callback is blocked, or you already have an auth code.
corelayer login --code <AUTH_CODE> --api-url <server-url>

Common Commands

Discover Groups

corelayer groups list
corelayer groups list --json

Set a Default Group

If you work in one group frequently, set it once:
corelayer config set default-group <group-id>

List Issues

corelayer issues list --group <group-id>
corelayer issues list --group <group-id> --status Open --severity High
corelayer issues list --json --group <group-id>
If you already set default-group, you can omit --group.

Inspect One Issue

corelayer issues get <issue-id>
corelayer issues get <issue-id> --json

Summarize Issues for a Group

corelayer issues summary --group <group-id>

Manage Issue State

corelayer issues close <issue-id> --feedback "resolved in deploy 2026-03-12"
corelayer issues reopen <issue-id>
corelayer issues delete <issue-id> --yes

List Integrations

corelayer integrations list
corelayer integrations list --group <group-id>
corelayer integrations list --json --group <group-id>

Inspect CLI Config

corelayer config get
corelayer config get api-url
corelayer config get default-group

Logout

corelayer logout

Global Flags

The CLI supports these global flags:
  • --json for machine-readable output
  • --quiet or -q to suppress success messages
  • --api-url <url> to override the configured API server
  • --no-color to disable ANSI color output

Dedicated Deployments

For browser login, you do not need to manually choose the API server. Corelayer returns the correct server_url during authorization and the CLI stores it in ~/.corelayer/config.json. Use --api-url only when:
  • you are doing manual login with an auth code
  • you are testing against a local or non-default environment
  • you explicitly want to override the stored server URL for one command

Using the CLI with AI Agents

The best pattern is:
  1. Install the CLI once
  2. Run corelayer login
  3. Prefer --json when an agent needs to read the output
  4. Set default-group if the agent will make repeated issue or integration calls
This docs repo includes a reusable agent instruction file at agents/corelayer-cli.md.

Command Types

Agents should treat CLI commands in three categories:

1. Read-Only Commands

These are safe to use for discovery, triage, and reporting:
  • corelayer groups list
  • corelayer issues list
  • corelayer issues get
  • corelayer issues summary
  • corelayer integrations list
  • corelayer config get
Best practice:
  • Prefer --json when an agent needs to reason over the output
  • Use corelayer groups list --json first if the correct group is not known
  • Set default-group before repeated issue or integration reads

2. Local State Commands

These change the local CLI session or local config, not Corelayer data on the server:
  • corelayer login
  • corelayer logout
  • corelayer config set default-group <group-id>
  • corelayer config set api-url <url>
Best practice:
  • corelayer login is fine when the user is actively trying to authenticate
  • use corelayer config set default-group when the user will run repeated commands against the same group
  • avoid changing api-url unless the user explicitly wants a different environment
  • avoid logout unless the user asks for it or the workflow clearly requires resetting auth

3. Write and Update Commands

These change data or issue state on the Corelayer server and should be used carefully:
  • corelayer issues close <issue-id> --feedback "..."
  • corelayer issues reopen <issue-id>
  • corelayer issues delete <issue-id> --yes
Best practice:
  • ask for explicit approval before running any of these commands
  • include a short, accurate reason when closing an issue
  • prefer close or reopen over delete
  • only use delete --yes when the user has clearly requested deletion
  • if the user is unsure, show the issue first with corelayer issues get <issue-id> --json

Investigate issues in one group

corelayer groups list --json
corelayer config set default-group <group-id>
corelayer issues list --json --status Open
corelayer issues get <issue-id> --json

Review integrations for a group

corelayer integrations list --json --group <group-id>

Summarize current issue health

corelayer issues summary --group <group-id>
Use it as a project instruction, repo memory, or agent prompt snippet:
When you need Corelayer data, prefer the `corelayer` CLI over raw HTTP requests.

- Run `corelayer groups list --json` first if the target group is unknown.
- If multiple commands will use the same group, run `corelayer config set default-group <group-id>`.
- Prefer `corelayer issues list --json`, `corelayer issues get <issue-id> --json`, and `corelayer integrations list --json`.
- Treat `corelayer issues close`, `corelayer issues reopen`, and `corelayer issues delete --yes` as write operations that require explicit user approval.
- Treat `corelayer config set` and `corelayer logout` as local state changes; use them only when the workflow clearly calls for them.
- If the user is not authenticated, ask them to run `corelayer login`.
This works well across agent tools. If a specific agent supports installable skills or command packs, wrap the same instructions in that tool’s native format instead of maintaining separate guidance by hand.

Troubleshooting

Browser Login Does Not Open

Copy the URL printed by corelayer login and open it manually in your browser.

Callback Fails on 127.0.0.1

Use manual login:
corelayer login --code <AUTH_CODE> --api-url <server-url>

Wrong Organization or Server

Log in again while the correct organization is active in the Corelayer app. The browser flow will return the correct server URL for that organization.

API Calls Fail After Switching Environments

Check the stored API server:
corelayer config get api-url
Then either:
  • run corelayer login again
  • or override the server for a command with --api-url <url>
Need help? Contact support for assistance with the Corelayer CLI.