Skip to content

Commit b9eece0

Browse files
Alex HolmbergAlex Holmberg
authored andcommitted
feat: added authentication, for agent usage
1 parent f562a94 commit b9eece0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ pub async fn run_command(command: Commands) -> Result<()> {
118118
use cli::ChatProvider;
119119
use config::load_agent_config;
120120

121+
// Check if user is authenticated with Syncable
122+
if !auth::credentials::is_authenticated() {
123+
println!("\n\x1b[1;33m📢 Sign in to use Syncable Agent\x1b[0m");
124+
println!(" It's free and costs you nothing!\n");
125+
println!(" Run: \x1b[1;36msync-ctl auth login\x1b[0m\n");
126+
return Err(error::IaCGeneratorError::Config(
127+
error::ConfigError::MissingConfig("Syncable authentication required".to_string())
128+
));
129+
}
130+
121131
let project_path = path.canonicalize().unwrap_or(path);
122132

123133
// Handle --resume flag

0 commit comments

Comments
 (0)