Skip to main content

Command Line

Install

go install github.com/go-arrower/arrower/...@latest

Verify:

$ arrower version

init

Scaffold a complete Arrower project with everything needed to start building.

arrower init <projectName> <importPath>

Arguments:

ArgumentDescriptionExample
projectNameName of the project (Title-cased)Myapp
importPathGo module import pathgithub.com/yourname/myapp

Example:

mkdir myapp && cd myapp
arrower init Myapp github.com/yourname/myapp

What gets created:

myapp/
├── .config/ # Config files, git hooks, linters
│ ├── githooks/ # commit-msg, pre-commit hooks
│ ├── tailwind.config.js
│ ├── golangci.yaml
│ ├── project.config.yaml # App config (test + default)
│ └── 001_start-containers.hook.go
├── cmd/ # Application CLI commands
├── shared/
│ ├── domain/ # Domain entities
│ ├── application/ # Use cases
│ ├── interfaces/ # Controllers, repositories
│ │ └── web/ # Web controllers
│ ├── views/ # HTML templates + base layout
│ ├── infrastructure/
│ │ ├── config/ # Config loading
│ │ └── postgres/ # Database migrations
│ ├── logging/ # Log attribute definitions
│ └── init/ # App initialisation + routes
├── devops/ # Docker Compose + configs
│ ├── grafana/ # Grafana datasource config
│ ├── pgadmin/ # pgAdmin config
│ ├── prometheus/ # Prometheus config
│ ├── tempo/ # Tempo config
│ └── docker-compose.yaml
├── public/ # Static assets (icons, CSS, JS)
├── tests/
│ └── e2e/ # Cypress E2E test setup
├── main.go
├── Makefile
├── package.json
└── go.mod

After scaffolding, arrower init automatically runs:

  • go mod tidy + go mod download
  • npm install --package-lock-only
  • make dev-tools
  • make generate
  • git init

Then commit and run:

git commit -m "chore: initial Arrower application"
arrower run
note

The init command is experimental. The generated project structure may change.

run

Start the application with hot reload.

arrower run

Behaviour:

File typeOn change
.goApp shuts down and restarts
.css, .js, .htmlBrowser reloads automatically

The application runs on http://localhost:8080. Hot reload server runs on port 3030.

Hooks in .config/ are loaded on startup and participate in the lifecycle:

  • OnConfigLoaded: modify config before the app starts
  • OnStart: run before the first build
  • OnChanged: run on every file change
  • OnShutdown: run on graceful shutdown

See Hooks for details.

generate

Generate boilerplate code for use cases and jobs.

arrower generate <type> <name>
arrower generate <type> <contextName> <name>

Aliases: gen

Types:

TypeAliasDescription
requestreqGenerate a Request Use Case (input + output)
commandcmdGenerate a Command Use Case (input only)
queryGenerate a Query Use Case (input + output, no side effects)
jobGenerate a Job handler
usecaseucAuto-detect type from the name suffix

Examples:

# Generate a specific Use Case type
arrower generate request helloWorld
arrower generate command createOrder
arrower generate query listUsers
arrower generate job sendEmail

# Auto-detect type from suffix
arrower generate uc helloWorldRequest # → request
arrower generate uc createOrderCommand # → command
arrower generate uc listUsersQuery # → query
arrower generate uc sendEmailJob # → job

# Generate for a specific context
arrower generate request <contextName> helloWorld

Each command creates two files in the application/ directory:

  • <name>.usecase.go: handler with request/response types
  • <name>.usecase_test.go: test with success case

See Use Cases - Code Generation for the generated output.

version

Print the Arrower version.

$ arrower version

completion

Generate shell autocompletion scripts.

arrower completion [bash|zsh|fish|powershell]

help

Show help for any command.

arrower help
arrower run --help
arrower generate --help