reset_config.py script removes all local configuration, credentials, and the virtual environment, returning the project to a freshly-cloned state.
Command Syntax
This script has no command-line options. It performs a complete reset when run.
What Gets Removed
The reset script removes:-
All files in
resources/secrets/:.env(credentials and tokens)- Any other secret files
-
Virtual environment:
- Entire
.venv/directory - All installed Python packages
- Entire
-
What’s preserved:
- ✅ All source code
- ✅
config/clients.yaml - ✅
config/email.yaml - ✅
config/asana_order.yaml - ✅
config/demo/directory (demo data) - ✅
config/demo_gmail_fake.yaml(demo flag) - ✅
context/directory (client data, bitácoras, transcriptions)
The script preserves demo mode configuration so you can continue testing without real API credentials.
Usage Examples
Standard reset
No configuration exists
If you run reset on a fresh clone:After reset, reconfigure
When to Use Reset
Usereset_config.py when:
- ✅ Switching Google accounts: Need to authorize with different credentials
- ✅ Troubleshooting authentication: Clear corrupt tokens or credentials
- ✅ Sharing the project: Remove your credentials before handing off to someone else
- ✅ Starting fresh: Want to reconfigure everything from scratch
- ✅ Security concern: Suspect credentials may be compromised
- ✅ Testing setup process: Verify the onboarding experience
Exit Codes
- 0: Always exits with success (even if nothing to delete)
What Happens to Credentials
Google OAuth tokens
GOOGLE_REFRESH_TOKENis deleted from.env- The token remains valid in Google’s systems until revoked
- To fully revoke: Google Account Permissions
Asana tokens
ASANA_ACCESS_TOKENis deleted from.env- The token remains valid in Asana until revoked
- To revoke: Asana App Settings
Client ID and secrets
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETare deleted- These remain valid in Google Cloud Console
- Obtain them again from: Google Cloud Console
Demo Mode Preservation
The reset script ensures demo mode continues working:- Preserves
config/demo/: Fake email data remains intact - Recreates
config/demo_gmail_fake.yaml: Flag file is restored if missing
config/demo/emails_fake.json- Sample email dataconfig/demo_gmail_fake.yaml- Flag to enable demo mode
Security Implications
Configuration Persistence
These configuration files are not deleted by reset:Client configuration
config/clients.yaml- Client matching keywordscontext/clients/*/- Client directories and data
Service configuration
config/email.yaml- Gmail sync settingsconfig/calendar.yaml- Calendar selectionconfig/asana_order.yaml- Task ordering by day
Demo configuration
config/demo/- Demo data filesconfig/demo_gmail_fake.yaml- Demo mode flag
Reset only removes secrets and runtime environment. All project configuration and data remain intact.
Re-setup After Reset
Quick re-setup (same credentials)
If you have your credentials saved:Full re-setup (new credentials)
Follow the main setup instructions:- Create Google Cloud project and enable APIs
- Create OAuth 2.0 credentials
- Get Asana Personal Access Token
- Copy
.env.exampleand fill in values - Run
setup_oauth.py - Test with
run_morning.py
Automation and CI/CD
Pre-commit hook
To prevent accidentally committing credentials:CI/CD environments
For testing in CI:Related Commands
- setup-oauth - Reconfigure Google OAuth after reset
- run-morning - Test configuration after re-setup
Troubleshooting
Permission denied
If reset fails with permission errors:Virtual environment in use
On Windows, deactivate the virtual environment first:Directory not empty
If.venv removal fails:
Manual Reset Alternative
You can reset manually without running the script:reset_config.py.
Implementation Details
The script uses Python’spathlib and shutil modules:
The script is safe to run multiple times. Running reset when already reset has no effect.