> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usegandalf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# gandalf init: create a team manifest scaffold

> Create a starter gandalf.toml and .gandalf/skills/ in your repository, optionally scaffolded from your current local agent setup, to enable team sync.

`gandalf init` scaffolds a team agent manifest at your project root. It writes a starter `gandalf.toml` and a `.gandalf/skills/` directory so teammates can standardize MCP servers, skills, and hooks across Codex and Claude Code.

## Synopsis

```bash theme={null}
gandalf init [flags]
```

## Flags

| Flag              | Description                               | Default                          |
| ----------------- | ----------------------------------------- | -------------------------------- |
| `--name`          | Project name in the manifest              | current directory name           |
| `--from-current`  | Scaffold from a scan of local agent setup | off                              |
| `-f`, `--force`   | Overwrite existing `gandalf.toml`         | off                              |
| `-p`, `--project` | Project directory                         | `.`                              |
| `--home`          | Home directory                            | `$HOME`                          |
| `--store`         | Gandalf store directory                   | `~/.gandalf` or `$GANDALF_STORE` |
| `--json`          | Emit JSON output                          | off                              |

## Examples

```bash theme={null}
gandalf init --name my-team-project
gandalf init --from-current
gandalf init --force
```

## Generated file

The default template includes an MCP server, skills scaffold, a hook, and an env template:

```toml gandalf.toml theme={null}
version = "1.0"
name = "my-team-project"
description = "Standardized AI agent environment for my-team-project"
agents = ["claude-code", "codex"]

[mcp_servers.postgres-db]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-postgres", "${DATABASE_URL}"]
required_env = ["DATABASE_URL"]
description = "Shared staging database MCP server"

[env_template]
DATABASE_URL = "postgres://user:password@localhost:5432/db"
```

With `--from-current`, existing local MCP servers become `[mcp_servers.<name>]` entries seeded with the source agent, ready to fill in `command`, `args`, or `url`.

## Next steps

1. Edit `gandalf.toml` to declare team MCP servers, skills, and hooks.
2. Commit `gandalf.toml` and `.gandalf/skills/` to Git.
3. Teammates run [`gandalf apply`](/cli/apply) to sync their local setup.

## Related

* [Team manifest guide](/guides/team-manifest)
* [Manifest reference](/reference/manifest)
