GuideDecember 1, 20267 min read

The Freelancer's Guide to Managing Multiple Client Environments

Different AWS accounts, different git emails, separate SSH keys, isolated .env files. Use ConfigSync profiles to keep client environments completely separate.

The Freelancer's Configuration Nightmare

Freelance developers face a configuration problem that employees never encounter: multiple completely separate environments on a single machine. Client A uses AWS with one set of credentials. Client B is on GCP with different credentials. Client C has a self-hosted GitLab instance with its own SSH key. You need different git emails for each client, different environment variables, and sometimes different tool versions.

The consequences of mixing these up range from embarrassing to catastrophic. Committing with the wrong git email leaks information about your other clients. Pushing to the wrong AWS account could deploy code to the wrong company's infrastructure. Accidentally including Client A's environment variables in Client B's project exposes secrets across organizational boundaries.

ConfigSync profiles solve this by creating isolated configuration contexts that you can switch between cleanly.

Creating Client Profiles

A ConfigSync profile is a named set of configurations, environment variables, and module overrides. Each profile acts as an isolated context for a specific client or project.

Set up client profiles
# Create a profile for Client Acme $ configsync profile create client-acme \ --path ~/clients/acme \ --env development # Create a profile for Client Globex $ configsync profile create client-globex \ --path ~/clients/globex \ --env staging # Create a profile for personal projects $ configsync profile create personal \ --path ~/personal \ --env development

Each profile is associated with a directory path. When you enter that directory, ConfigSync can automatically activate the corresponding profile, switching your git email, AWS credentials, and environment variables without any manual intervention.

Isolating Git Identities

One of the most common freelancer mistakes is committing with the wrong email address. ConfigSync profiles override your git identity per client.

Set git identity per profile
# Set git config for Acme $ configsync profile config client-acme \ git.user.name "Sean Developer" \ git.user.email "sean@acme-consulting.com" # Set git config for Globex $ configsync profile config client-globex \ git.user.name "Sean Developer" \ git.user.email "sean@globex-project.com" # When you cd into ~/clients/acme, git automatically uses # the Acme email. No more wrong-email commits.
Profile-based git configuration uses git's built-in includeIf directive, which means it works with any git workflow. You do not need to remember to switch anything manually.

Separate AWS Accounts and Cloud Credentials

Each client likely has their own AWS account, GCP project, or Azure subscription. Profiles keep these credentials isolated so you never accidentally deploy to the wrong account.

Configure cloud credentials per profile
# Set AWS profile for Acme $ configsync profile secret client-acme AWS_ACCESS_KEY_ID $ configsync profile secret client-acme AWS_SECRET_ACCESS_KEY $ configsync profile secret client-acme AWS_DEFAULT_REGION # Set different AWS credentials for Globex $ configsync profile secret client-globex AWS_ACCESS_KEY_ID $ configsync profile secret client-globex AWS_SECRET_ACCESS_KEY # Each profile activates its own set of credentials $ configsync profile activate client-acme Active profile: client-acme AWS_DEFAULT_REGION=us-east-1 Git email: sean@acme-consulting.com

Separate SSH Keys Per Client

Using the same SSH key for all clients is a security risk. If one client's systems are compromised, the attacker has a key that also works for your other clients. Use separate keys and let profiles manage which one is active.

SSH keys per client
# Generate client-specific SSH keys $ ssh-keygen -t ed25519 -f ~/.ssh/acme_key -C "acme" $ ssh-keygen -t ed25519 -f ~/.ssh/globex_key -C "globex" # Associate keys with profiles $ configsync profile config client-acme ssh.identity ~/.ssh/acme_key $ configsync profile config client-globex ssh.identity ~/.ssh/globex_key
ConfigurationClient AcmeClient GlobexPersonal
Git emailsean@acme-consulting.comsean@globex-project.comsean@personal.dev
AWS accountacme-prod (us-east-1)globex-dev (eu-west-1)personal (us-west-2)
SSH key~/.ssh/acme_key~/.ssh/globex_key~/.ssh/id_ed25519
Base directory~/clients/acme/~/clients/globex/~/personal/

Environment Files Per Client

Each client project has its own .env files with database URLs, API keys, and service credentials. These must be completely isolated between clients.

Track env files per profile
# Add env files scoped to the Acme profile $ configsync profile env client-acme ~/clients/acme/webapp/.env.local $ configsync profile env client-acme ~/clients/acme/api/.env # Add env files scoped to Globex $ configsync profile env client-globex ~/clients/globex/app/.env.local # Each profile's env files are encrypted separately # and only restored when that profile is active

Automatic Profile Switching

The most powerful feature for freelancers is automatic profile activation based on your working directory. When you cd into a client's project directory, the profile activates automatically.

Enable auto-switching
# Enable directory-based auto-switching $ configsync config set profiles.auto-switch true # Now when you navigate: $ cd ~/clients/acme/webapp [configsync] Activated profile: client-acme $ cd ~/clients/globex/app [configsync] Activated profile: client-globex # Your git email, AWS credentials, and SSH key # switch automatically. Zero chance of cross-contamination.

This is the difference between "hoping you remembered to switch contexts" and "knowing your environment is correct." For freelancers managing three, five, or ten clients, automatic switching eliminates an entire category of errors. You never accidentally push to the wrong client's AWS account because the credentials were never active in the wrong directory.

Syncing Your Freelance Setup

All profiles sync as part of your regular ConfigSync push. When you pull on another machine, every client profile is restored with its own credentials, git identity, and environment files.

Push all profiles
$ configsync push -m "Freelance setup - 3 client profiles" Syncing profile: client-acme (4 secrets, 2 env files) Syncing profile: client-globex (3 secrets, 1 env file) Syncing profile: personal (1 secret, 0 env files) Encrypting all profile secrets... Pushed snapshot (2.9 MB) in 5s.

Ready to try ConfigSync?

Sync your entire dev environment across machines in minutes. Free forever for up to 3 devices.