Skip to content
rhyekPublic

About

A terminal UI and CLI for a monorepo's services, infrastructure, tests and CI during development.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

85 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stackctl

Run your monorepo's stack in one terminal.

stackctl is a terminal UI and CLI for a monorepo's services, infrastructure, tests and CI during development. You describe your services once, in a small typed config file. stackctl starts the ones you pick and the services they need, brings up their infrastructure, loads their environment, and shows it all in one place.

stackctl's terminal UI running the example monorepo

Documentation: stackctl.dev

Features

  • One typed config. stackctl.config.ts describes every service. Pick one and the services it needs come with it, started in order and held until they are healthy.
  • Lifecycle hooks. Steps of your own before a service starts, once it is ready and before it stops, with the same hooks on the session, each service and the infra: codegen, migrations, a webhook to register and remove.
  • A terminal UI. One combined, filterable log, with each service's state and memory in the footer. Drive it with the keyboard or the mouse.
  • Readable JSON logs. Log JSON in every environment: each line is shown as a colored [LEVEL] message with its fields listed below it, nested ones and stack traces included.
  • Built for coding agents. A headless mode, a localhost control API, an installable skill and llms.txt.
  • Infra included. Point it at your docker-compose.yaml: databases and brokers come up, get healthy and get migrated before your services start.
  • Environment handled. Layered .env files per workspace, service and profile, injected into each process and reloaded when a file changes.
  • A hostname per service. An optional dev reverse proxy, over TLS too, with a status page while a service starts.
  • The same stack in tests and CI. startStack() for an e2e suite, stackctl start --detach for a CI job, in a profile that runs beside your dev session.
  • An SDK for scripts and tests. startStack(), exec(), run() and resolveEnv() give your own code what the CLI gives a shell, typed and with the same environment.
  • Any language. A service is a dev script in package.json or a Makefile target.

Install

pnpm add -D stackctl
pnpm stackctl init

Requires Node.js 26.12.1 or newer, on macOS or Linux.

Quick start

// stackctl.config.ts
import { defineConfig } from 'stackctl';

export default defineConfig({
  serviceRootDir: 'apps', // each service lives at apps/<name>
  services: {
    api: {
      // read from api's .env files, and given to the process as PORT
      port: ({ envs }) => Number(envs.API_PORT),
      healthcheck: '/health',
    },
    web: {
      port: 3000,
      // selecting web also runs api, and holds web until api is healthy
      deps: [{ service: 'api', wait: true }],
    },
  },
});

Each service needs a dev script in its package.json, or a dev target in a Makefile. Then:

pnpm stackctl                 # the terminal UI: pick services, run them
pnpm stackctl --headless -s web   # no UI: stream logs to stdout
pnpm stackctl run api seed    # one script, with api's environment
pnpm stackctl infra start     # start the infra, then exit

Documentation

A complete example monorepo is in example/.

For coding agents, the docs are indexed at stackctl.dev/llms.txt, and ship inside the package at node_modules/stackctl/docs/llms.txt.

License

MIT

About

A terminal UI and CLI for a monorepo's services, infrastructure, tests and CI during development.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages