# amfelt commit

Commit the bound project's config to Git (git-lite push).

Commit this host's local project config to the environment's connected Git
repository via the Amfelt control plane (git-lite push).

Gathers the bound project's amfelt.yaml plus every contracts/*.odcs.yaml and
pushes them, guarded by the base SHA recorded on the project binding the last
time this host synced. A source whose contract is not one of those files,
exactly as named in amfelt.yaml and case included, stops the commit before
anything is pushed, and the error says what fixes it: a contracts/``<name>``.yaml
or ``<name>``.yaml an older import wrote is moved, a missing file is restored, and
a reference written with backslashes is rewritten with forward slashes. So a
source never reaches Git without its contract. A login that add-target
`--user` and `--password` store lives in the control-plane vault, and amfelt.yaml
holds only its reference. A target's user or password that amfelt.yaml itself
holds, written with add-target `--store-login-in-file`, by an agent older than
v4.18.2 or by hand, stops the commit before anything is pushed: no commit
carries a login, so once the commit is deployed or pulled the target would have
none. The error names the step that moves it out of the file: add-target with
`--force` and the target's connection, which stores the login in the vault. Any
other server credential in amfelt.yaml, such as a source's login or an
sslpassword, is left out of what is pushed, and a warning names it.

A project file whose id names another project than `--project` stops the commit
before anything is pushed, and `--force` does not override it. The first push of
an environment this host has never synced lands in a repository the host has
never read, for a new project an empty one: it stops when the folder holds a
file the bound project did not create (a project file with no id, a contract no
source names, a template override for a plugin no source or target uses), and
the error lists what the push would commit. Pass `--force` to push them anyway.

If the remote branch has moved since this host last synced, the push is
rejected — run `amfelt pull` first, then commit again.

The (project, environment) pair must already be bound on this host (see the
project manifest written at setup time).

Examples:

```text
  amfelt commit --project <uuid> --env development --message "add sales job"
```

## Usage

```text
amfelt commit [flags]
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--env` | `string` | — | DTAP environment slug to commit (required) |
| `--force` | `bool` | `false` | on the first push of an environment, push files the bound project did not create instead of refusing |
| `--message` | `string` | — | commit message (not yet sent — the control plane sets the commit message) |
| `--project` | `string` | — | control-plane project id (uuid) to commit (required) |
{.clidoc-flags-table}

## Global flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--amfelt-dir` | `string` | `.amfelt` | directory for workspace files (such as plugins); does not move agent identity (controlled by AMFELT_DIR) |
| `--config` | `string` | — | directory or filename of the application configuration |
| `-f`, `--format` | `string` | `default` | log format to use; either default, pretty, or json |
| `-l`, `--level` | `string` | `info` | minimum log level to display; either error, warn, info, or debug |
| `-v`, `--verbose` | `bool` | `false` | trigger to use verbose logging |
{.clidoc-flags-table}

---

Generated from `amfelt` v5.6.3.
