Skip to main content

acc init

Initialize project configuration in the current directory, linking it to an Accomplish project.

Usage​

acc init

Description​

The init command sets up project-specific configuration for the current directory. It:

  1. Detects git repository information (if available)
  2. Prompts you to select or create a project from your Accomplish workspace
  3. Creates .accomplish.toml with your default project configuration
  4. Updates global directory mapping to remember this association

What It Does​

Git Repository Detection​

If you're in a git repository, init will:

  • Detect the repository name
  • Read the remote origin URL
  • Use this information to suggest project names

Project Configuration​

Creates .accomplish.toml in the current directory:

[project]
default_project = "ABC" # Your selected project identifier

Directory Mapping​

Updates ~/.accomplish/directories.toml to remember the association:

"/path/to/your/project" = "ABC"

Interactive Flow​

$ acc init

Detected git repository: my-awesome-app
Remote: https://github.com/user/my-awesome-app.git

Select a project or create a new one:
1. Existing Project (ABC)
2. Another Project (XYZ)
3. Create new project

Choice: 3
Project name: My Awesome App
Project description (optional): A revolutionary web application
Project identifier (optional, auto-generated): AWE

Created project: My Awesome App (AWE)
Configured directory mapping: /path/to/my-awesome-app -> AWE
Created .accomplish.toml

Benefits​

After running init in a project directory:

  • Automatic project association: Commands use the configured project by default
  • Simplified logging: No need to specify -p PROJECT flag

Example Workflow​

# Navigate to your project
cd ~/projects/my-web-app

# Initialize Accomplish configuration
acc init
# Configures project "WEB" for this directory

# Now logging automatically uses the WEB project
acc log -m "Implemented user authentication"
# Equivalent to: acc log -m "Implemented user authentication" -p WEB

# View logs for this project
acc logs
# Shows entries for the WEB project by default

File Creation​

.accomplish.toml​

Created in the current directory:

[project]
default_project = "ABC" # 3-letter project identifier

Directory Mapping​

Updated in ~/.accomplish/directories.toml:

"/Users/username/projects/web-app" = "WEB"
"/Users/username/work/api-service" = "API"

Requirements​

  • Must be authenticated (acc login)
  • Must have at least one project in your workspace (or create one during init)

Notes​

  • Safe to run multiple times in the same directory
  • Will update existing configuration if run again
  • Does not modify git repository or other project files
  • Only creates .accomplish.toml and updates global mappings