@rpallas/outcrop-cli
Scaffolding and CI helpers for services built with @rpallas/outcrop.
npx @rpallas/outcrop-cli create service orders --http-api --dynamodb --auth jwt-auth0
npx @rpallas/outcrop-cli create account my-platform --owner my-org --domain example.com
npx @rpallas/outcrop-cli preview-id --branch feature/ABC-123-thing --pr 42 # abc-123
npx @rpallas/outcrop-cli stack-outputs --outputs-file cdk-outputs.json --prefix PREVIEW_ --github-env
npx @rpallas/outcrop-cli sync-skillsCommands
| Command | Purpose |
|---|---|
create service <name> | Generates a complete service repository: infra, handlers, tests, workflows and docs. |
create account <name> | Generates an account baseline app using @rpallas/outcrop-account. |
preview-id | Derives the preview id (abc-123 from a ticket in the branch name, else pr-<n>). |
stack-outputs | Reads CloudFormation outputs (from cdk deploy --outputs-file or the API) and exports them. |
sync-skills | Copies the bundled agent skills into .agents/skills so coding agents follow the conventions. |
Service variants
Variants can be combined: --http-api, --queue-consumer, --event-subscriber, --scheduled, --static-site, --dynamodb, --neon. --auth none|jwt-auth0|jwt-cognito|api-key protects the HTTP API. The generated infra/lib/service-stack.ts is plain CDK code intended to be edited; the templates are a starting point, not a framework.
Generated repositories consume the reusable workflows from this repository (rpallas/outcrop/.github/workflows/*.yml@v1) and expect these repository variables: AWS_REGION, AWS_DEPLOY_ROLE_ARN_DEV (and _PROD, AWS_READONLY_ROLE_ARN_DEV for diffs).
Run outcrop create service --help for the full option list.
Classes
CliError
Defined in: io.ts:40
Extends
Error
Constructors
Constructor
new CliError(message, exitCode?): CliError;Defined in: io.ts:41
Parameters
| Parameter | Type | Default value |
|---|---|---|
message | string | undefined |
exitCode | number | 1 |
Returns
Overrides
Error.constructorProperties
| Property | Modifier | Type | Default value | Defined in |
|---|---|---|---|---|
exitCode | readonly | number | 1 | io.ts:43 |
Interfaces
PreviewIdSource
Defined in: preview-id.ts:48
Properties
| Property | Type | Defined in |
|---|---|---|
branch? | string | preview-id.ts:49 |
prNumber? | string | number | preview-id.ts:50 |
ServiceStackSpec
Defined in: scaffold/service-stack.ts:17
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
auth | readonly | "none" | "jwt-auth0" | "jwt-cognito" | "api-key" | scaffold/service-stack.ts:20 |
service | readonly | string | scaffold/service-stack.ts:18 |
variants | readonly | ReadonlySet< | "http-api" | "queue-consumer" | "event-subscriber" | "scheduled" | "static-site" | "dynamodb" | "neon"> | scaffold/service-stack.ts:19 |
Type Aliases
AuthMode
type AuthMode = typeof AUTH_MODES[number];Defined in: scaffold/service-stack.ts:15
PreviewIdStrategy
type PreviewIdStrategy = "ticket-then-pr" | "pr" | "branch-slug";Defined in: preview-id.ts:8
ServiceVariant
type ServiceVariant = typeof SERVICE_VARIANTS[number];Defined in: scaffold/service-stack.ts:12
TemplateVars
type TemplateVars = Record<string, string | boolean | undefined>;Defined in: scaffold/template.ts:1
Variables
AUTH_MODES
const AUTH_MODES: readonly ["none", "jwt-auth0", "jwt-cognito", "api-key"];Defined in: scaffold/service-stack.ts:14
HELP
const HELP: "outcrop - scaffolding and CI helpers for outcrop services\n\nUsage: outcrop <command> [options]\n\nCommands:\n create service <name> Scaffold a new service (see: outcrop create service --help)\n create account <name> Scaffold an account baseline app\n preview-id Derive the preview id for a pull request\n stack-outputs Print / export CloudFormation stack outputs\n oidc-subject <owner/repo> Print a repository's OIDC subject and ids for account.config.ts\n sync-skills Copy the bundled agent skills into ./.agents/skills\n help Show this help\n\nRun any command with --help for details.";Defined in: index.ts:14
HELP_TEXT
const HELP_TEXT: Record<string, string>;Defined in: index.ts:46
PREVIEW_ID_MAX_LENGTH
const PREVIEW_ID_MAX_LENGTH: 20 = 20;Defined in: preview-id.ts:7
PREVIEW_ID_RE
const PREVIEW_ID_RE: RegExp;Defined in: preview-id.ts:6
Preview id derivation. This is a CDK-free copy of the rules in @rpallas/outcrop (config/preview-id.ts) so that CI, the CLI and the CDK app agree without the CLI depending on aws-cdk-lib. Keep both in sync.
PREVIEW_ID_STRATEGIES
const PREVIEW_ID_STRATEGIES: readonly PreviewIdStrategy[];Defined in: preview-id.ts:9
SERVICE_VARIANTS
const SERVICE_VARIANTS: readonly ["http-api", "queue-consumer", "event-subscriber", "scheduled", "static-site", "dynamodb", "neon"];Defined in: scaffold/service-stack.ts:3
Functions
assertValidPreviewId()
function assertValidPreviewId(value): string;Defined in: preview-id.ts:20
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
string
branchSlug()
function branchSlug(branch): string;Defined in: preview-id.ts:37
Parameters
| Parameter | Type |
|---|---|
branch | string |
Returns
string
derivePreviewId()
function derivePreviewId(source, strategy?): string;Defined in: preview-id.ts:53
Parameters
| Parameter | Type | Default value |
|---|---|---|
source | PreviewIdSource | undefined |
strategy | PreviewIdStrategy | "ticket-then-pr" |
Returns
string
isValidPreviewId()
function isValidPreviewId(value): boolean;Defined in: preview-id.ts:17
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
boolean
main()
function main(argv, io?): Promise<number>;Defined in: index.ts:52
Parameters
| Parameter | Type | Default value |
|---|---|---|
argv | string[] | undefined |
io | Io | processIo |
Returns
Promise<number>
renderServiceStack()
function renderServiceStack(spec): string;Defined in: scaffold/service-stack.ts:29
Generates infra/lib/service-stack.ts for the selected variants. Kept as code (not a template) so the combinations stay consistent and type-safe.
Parameters
| Parameter | Type |
|---|---|
spec | ServiceStackSpec |
Returns
string
renderTemplate()
function renderTemplate(content, vars): string;Defined in: scaffold/template.ts:12
Tiny mustache-like renderer: {{var}}, {{#if flag}}...{{/if}}, {{#unless flag}}...{{/unless}}. Blocks may nest one level deep by running the block regex until no more blocks match. Unknown variables throw so templates never ship placeholders.
Parameters
| Parameter | Type |
|---|---|
content | string |
vars | TemplateVars |
Returns
string
ticketFromBranch()
function ticketFromBranch(branch): string | undefined;Defined in: preview-id.ts:29
Parameters
| Parameter | Type |
|---|---|
branch | string |
Returns
string | undefined
toCamelCase()
function toCamelCase(value): string;Defined in: scaffold/template.ts:41
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
string
toConstantCase()
function toConstantCase(value): string;Defined in: scaffold/template.ts:46
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
string
toPascalCase()
function toPascalCase(value): string;Defined in: scaffold/template.ts:34
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
string
References
previewId
Renames and re-exports derivePreviewId