This guide will help you get started with the Go version of the StoreConnect CLI.
- Go 1.21 or later: Download Go
- Make (optional): For build automation
- Git: For version control
# Navigate to the Go CLI directory
cd cli-go
# Download dependencies
make deps
# Build the binary
make build
# The binary is now available at: bin/sc
./bin/sc --help
# Optional: Install to $GOPATH/bin (adds to PATH)
make install
sc --helpcd cli-go
go install ./cmd/sc
sc --help# Create a new project
sc init my-store-project
# Navigate into the project
cd my-store-projectThis creates:
my-store-project/
├── .storeconnect/
│ └── config.yml # Project config (safe to commit)
└── themes/ # Theme files go here
sc connect https://dev.mystore.com --alias devYou'll be prompted for:
Organization ID:
- Find: Salesforce Setup → Company Information
- Format: 15-18 characters starting with "00D"
- Example:
00D000000000062ABC
Store Salesforce ID:
- Find: Your Store record URL in Salesforce
- Format: 15-18 alphanumeric characters
- Example:
a0A7Z00000AbCdE
API Key:
- Generate: Store record → API Keys → New API Key
- Security: Input is hidden for security
- Store securely: Don't share or commit to git
sc statusOutput shows:
ℹ Project Configuration
* dev
URL: https://dev.mystore.com
Version: 20.13.0
Base Theme: 1.2.3
* = default server
Credentials stored in: /Users/you/.storeconnect/credentials.yml
sc theme listsc theme pull my-themeThis downloads the theme to themes/my-theme/:
themes/my-theme/
├── theme.yml
├── templates/
│ ├── pages/
│ ├── snippets/
│ └── layouts/
├── assets.json
├── variables.json
└── locales/
sc theme new my-new-theme# Connect to staging
sc connect https://staging.mystore.com --alias staging
# Connect to production
sc connect https://mystore.com --alias prod
# Use specific server
sc theme list --server staging
sc theme pull my-theme --server prod
# Set default server
sc config set-default-server prod# 1. Pull theme from server
sc theme pull my-theme
# 2. Edit files in themes/my-theme/
# 3. Push changes (creates draft)
sc theme push my-theme
# 4. Preview changes
sc theme preview my-theme
# 5. Publish to live site
sc theme publish my-theme# Develop on dev server
sc theme pull my-theme --server dev
# ... make changes ...
sc theme push my-theme --server dev
sc theme preview my-theme --server dev
# Promote to staging
sc theme push my-theme --server staging
sc theme publish my-theme --server staging
# Promote to production
sc theme push my-theme --server prod
sc theme publish my-theme --server prodLocation: Your home directory Permissions: 0600 (read/write owner only) Contains: API keys and Store IDs Security: NEVER commit to git
servers:
dev:
url: https://dev.mystore.com
org_id: 00D000000000062ABC
store_sfid: a0A7Z00000AbCdE
api_key: your-dev-api-key-here
prod:
url: https://mystore.com
org_id: 00D000000000062ABC
store_sfid: a0A7Z00000XyZ123
api_key: your-prod-api-key-hereLocation: Project directory Permissions: 0644 (readable by all) Contains: Server URLs and metadata Security: SAFE to commit to git
default_server: dev
servers:
dev:
url: https://dev.mystore.com
storeconnect_version: "20.13.0"
base_theme_version: "1.2.3"
last_sync: 2024-03-15T10:30:00Zsc version- Show CLI versionsc init PROJECT- Create new projectsc connect URL --alias NAME- Connect to serversc disconnect ALIAS- Remove serversc status- Show connection status
sc theme list- List themessc theme pull NAME- Download themesc theme new NAME- Create new themesc theme push NAME- Upload theme (draft)sc theme preview NAME- Get preview URLsc theme publish NAME- Publish to livesc theme delete NAME- Delete themesc theme validate NAME- Validate structure
--server ALIASor-s ALIAS- Use specific server--config PATH- Custom config file
# Verify your credentials
sc status
# Check that credentials file exists
ls -la ~/.storeconnect/credentials.yml
# Reconnect to server
sc disconnect dev
sc connect https://dev.mystore.com --alias dev# Initialize project
sc init my-project
cd my-project
# Or if already in project directory
ls -la .storeconnect/config.yml# Fix permissions
chmod 600 ~/.storeconnect/credentials.yml# General help
sc --help
# Command-specific help
sc theme --help
sc theme push --help- README.md - Installation and overview
- CLAUDE.md - Architecture and development guide
- API Documentation - See
/gem/CLAUDE.mdfor API endpoints
- GitHub Issues: https://github.com/GetStoreConnect/storeconnect-cli/issues
- Documentation: https://docs.storeconnect.com
- Read the README.md for full feature list
- Check CLAUDE.md for architecture details
- Explore theme structure in
themes/directory - Review API documentation in
/gem/CLAUDE.md - Set up your development workflow
Development Mode:
- Auto-publishes changes
- Faster iteration
- Safe to experiment
Production Mode:
- Changes require review
- Manual approval in Salesforce
- Safer deployment
Set environment appropriately when connecting!