$ initiat commands
$ initiat secret export
Export a secret value to a file
Back to Docs

Usage

      initiat secret export <secret-key> --output FILE [options]
      
    

Arguments

secret-key required

The key/name for the secret

Options

--output required

Output file path

-f | --force

Overwrite existing key without confirmation

-P | --project-path

Full project path (org/project) or alias

-p | --project

Project name (uses default org or --org)

--org

Organization slug (used with --project)

Examples

Export secret to a file

      initiat secret export API_KEY --output .env --project-path acme-corp/production
      
    

Export to deep directory (creates folders)

      initiat secret export API_KEY --output config/secrets.env -P acme-corp/production
      
    

Export with force override

      initiat secret export API_KEY --output secrets.txt --force
      
    

How it works

  1. Retrieves and decrypts secret from server

  2. Creates output directory if it doesn't exist

  3. Checks for existing key in file (prompts if found)

  4. Writes secret in KEY=VALUE format

  5. Detects git repository and suggests .gitignore

Output

      🔍 Getting secret 'API_KEY' from project acme-corp/production...
🔓 Decrypting secret value...
⚠️  File 'secrets.env' is not in .gitignore. Add it? (y/N): y
✅ Added 'secrets.env' to .gitignore
✅ Secret 'API_KEY' exported to secrets.env

      
    
© 2025 Initiat Technologies. All rights reserved.