-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhanced Configuration Management and Submodule Handling (#58)
- **Local Configuration:** Added `config.local.json` for project-specific settings. - **Submodule Enhancements:** Improved detection, handling, and syncing processes for submodules. - **CLI Refactor:** Introduced new commands (`auth`, `remote`, `push`) to streamline project management. - **Smart Syncing:** Implemented directory-aware syncing for efficient operations. - **Session Management:** Externalized session keys to enable provider-specific configurations.
- Loading branch information
Showing
40 changed files
with
1,659 additions
and
1,697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"active_provider": "claude.ai", | ||
"active_organization_id": "e731f9fc-edb4-420d-aa35-952e2ce77137", | ||
"active_project_id": "726c9cf7-394f-43f7-aced-bfa64ad2e1fb", | ||
"active_project_name": "ClaudeSync", | ||
"default_sync_category": "all_files" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "claudesync" | ||
version = "0.5.3" | ||
version = "0.5.4" | ||
authors = [ | ||
{name = "Jahziah Wagner", email = "[email protected]"}, | ||
] | ||
|
@@ -14,14 +14,18 @@ classifiers = [ | |
"Operating System :: OS Independent", | ||
] | ||
dependencies = [ | ||
"click==8.1.7", | ||
"click_completion==0.5.2", | ||
"pathspec==0.12.1", | ||
"pytest==8.3.2", | ||
"python_crontab==3.2.0", | ||
"setuptools==73.0.1", | ||
"sseclient_py==1.8.0", | ||
"tqdm==4.66.5", | ||
"click>=8.1.7", | ||
"click_completion>=0.5.2", | ||
"pathspec>=0.12.1", | ||
"pytest>=8.3.2", | ||
"python_crontab>=3.2.0", | ||
"setuptools>=73.0.1", | ||
"sseclient_py>=1.8.0", | ||
"tqdm>=4.66.5", | ||
"pytest-cov>=5.0.0", | ||
"claudesync>=0.5.4", | ||
"crontab>=1.0.1", | ||
"python-crontab>=3.2.0" | ||
] | ||
keywords = [ | ||
"sync", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import click | ||
|
||
from claudesync.provider_factory import get_provider | ||
from ..exceptions import ProviderError | ||
from ..utils import handle_errors | ||
|
||
|
||
@click.group() | ||
def auth(): | ||
"""Manage authentication.""" | ||
pass | ||
|
||
|
||
@auth.command() | ||
@click.option( | ||
"--provider", | ||
prompt="Choose provider", | ||
type=click.Choice(["claude.ai"], case_sensitive=False), | ||
default="claude.ai", | ||
help="The provider to use for this project", | ||
) | ||
@click.pass_context | ||
@handle_errors | ||
def login(ctx, provider): | ||
"""Authenticate with an AI provider.""" | ||
config = ctx.obj | ||
provider_instance = get_provider(config, provider) | ||
|
||
try: | ||
session_key, expiry = provider_instance.login() | ||
config.set_session_key(provider, session_key, expiry) | ||
click.echo( | ||
f"Successfully authenticated with {provider}. Session key stored globally." | ||
) | ||
except ProviderError as e: | ||
click.echo(f"Authentication failed: {str(e)}") | ||
|
||
|
||
@auth.command() | ||
@click.pass_obj | ||
def logout(config): | ||
"""Log out from all AI providers.""" | ||
config.clear_all_session_keys() | ||
click.echo("Logged out from all providers successfully.") | ||
|
||
|
||
@auth.command() | ||
@click.pass_obj | ||
def ls(config): | ||
"""List all authenticated providers.""" | ||
authenticated_providers = config.get_providers_with_session_keys() | ||
if authenticated_providers: | ||
click.echo("Authenticated providers:") | ||
for provider in authenticated_providers: | ||
click.echo(f" - {provider}") | ||
else: | ||
click.echo("No authenticated providers found.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import click | ||
from ..utils import handle_errors, validate_and_get_provider | ||
|
||
|
||
@click.group() | ||
def file(): | ||
"""Manage remote project files.""" | ||
pass | ||
|
||
|
||
@file.command() | ||
@click.pass_obj | ||
@handle_errors | ||
def ls(config): | ||
"""List files in the active remote project.""" | ||
provider = validate_and_get_provider(config, require_project=True) | ||
active_organization_id = config.get("active_organization_id") | ||
active_project_id = config.get("active_project_id") | ||
files = provider.list_files(active_organization_id, active_project_id) | ||
if not files: | ||
click.echo("No files found in the active project.") | ||
else: | ||
click.echo( | ||
f"Files in project '{config.get('active_project_name')}' (ID: {active_project_id}):" | ||
) | ||
for file in files: | ||
click.echo( | ||
f" - {file['file_name']} (ID: {file['uuid']}, Created: {file['created_at']})" | ||
) |
Oops, something went wrong.