Setup
Link a directory, pull environment variables and provision local API credentials in one command.
gigadrive setup is the one command that gets a fresh checkout ready for local development against
Gigadrive Network. It links the directory to an application, as
Project linking describes, then pulls that application's
non-sensitive environment variables, provisions API credentials, and writes all of it to
.env.local.
gigadrive setupLinked this directory to application 0195c11c-0000-7000-8000-000000000042.
Local dev environment ready.
• Wrote 7 variable(s) and API credentials to .env.local.
• Skipped 2 sensitive variable(s) (only production/preview hold secrets).
• Added .env.local to .gitignore.
• Your app can now call the Gigadrive API via the SDK (GIGADRIVE_CLIENT_ID/SECRET).The first line appears only when the directory was not already linked, and the Skipped and Added
lines only when they apply.
Arguments and flags
| Argument or flag | Alias | Description |
|---|---|---|
file | Output file to write (default: .env.local) | |
--app | -a | Application ID to set up (skips the interactive picker) |
--org | -o | Only list applications belonging to this organization ID when picking |
--environment | -e | Environment slug to resolve overrides for (e.g. preview) |
--yes | -y | Overwrite an existing file without confirmation |
--rotate | Force a fresh API key, revoking the previous one |
There is no --with-credentials flag here, because setup always provisions credentials.
gigadrive setup .env.development --environment preview --yesPicking the application
In an unlinked directory the CLI lists the applications you can reach. One result is selected
automatically; several open a picker titled Select an application to set up. --app skips the
picker and must name an application in that list. With no applications at all the command stops and
tells you to create one in the console.
Once a directory is linked, the picker never runs and --app and --org are ignored with a printed
note. Run gigadrive unlink first to point the directory somewhere else.
What lands in the file
Non-sensitive variables resolved for the application, then three credential entries:
GIGADRIVE_CLIENT_ID, GIGADRIVE_CLIENT_SECRET and GIGADRIVE_API_BASE_URL. The file is written
with mode 0600 and its name is added to .gitignore. Secrets stay behind: sensitive variables are
counted in the output and never sent.
Credentials come from an application-scoped API key holding the single scope
network:env_vars:read, with the API's default 90 day expiry. --rotate revokes the key this CLI
last provisioned for the application on this machine and mints a new one; without it, credentials
already present in the target file are reused. Environment variables documents
that rule in full, along with env pull for a directory that is already set up.
If the target file already exists you get an overwrite prompt that defaults to No, and --yes skips it.
Declining leaves the file alone and mints no key. Ctrl+C at either prompt prints Cancelled. and
exits without changing anything.
