arc init

Bootstrap new Architect project code. Running arc init in an empty directory creates a default app.arc manifest file named after that directory with one default @http function at src/http/get-index. Pass a directory name as a final positional argument to create a project in the specified directory. Edit app.arc, expanding the manifest, adding functions and re-running arc init to generate further code. This command is idempotent: intended to be run and re-run; it will only generate files if they do not already exist.

If you run this command with the --plugin flag, a scaffolded Architect plugin will be created instead.

Usage

arc init [flags] [path/to/project-directory]

Flags

  • -n, --name: Set the @app namespace for the created app
  • --no-install: Do not automatically install @architect/architect as a dependency in the project
  • -p, --plugin: Create a new scaffolded Architect plugin instead of a new Architect project
  • --runtime, -r: Create a new project with the specified runtime. Defaults to node. See the runtime configuration documentation for available options.
  • --verbose, -v: Even more output

Local preferences: @create

arc init can use specified templates when scaffolding new resources. Options are set with @create in local preferences.

  • templates - Specify templates for automatic resource scaffolding.
    • <pragma name> path/to/template.ext
@create
templates
  http path/to/template/http.js
  events path/to/template/events.py

Examples

Create a new app

mkdir myapp
cd myapp
arc init

Create a Node app with Architect installed locally

Bash/cmd.exe
npm init @architect myapp
PowerShell
npm init "@architect" myapp