lockthard-cli 0.2.6__tar.gz → 0.2.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lockthard-cli
3
- Version: 0.2.6
4
- Summary: CLI and AI agent client for LOCKTHARD — query 2100+ curated AI tools across 86+ tablets
5
- Author-email: Lockthard Team <info@loktar.cc>
3
+ Version: 0.2.7
4
+ Summary: CLI and AI agent client for LOKTAR — query 2100+ curated AI tools across 86+ tablets
5
+ Author-email: Loktar Team <info@loktar.cc>
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://loktar.cc
8
- Keywords: cli,ai-tools,agents,mcp,lockthard
8
+ Keywords: cli,ai-tools,agents,mcp,loktar,lockthard
9
9
  Classifier: Development Status :: 4 - Beta
10
10
  Classifier: Environment :: Console
11
11
  Classifier: Intended Audience :: Developers
@@ -0,0 +1,5 @@
1
+ """
2
+ LOKTAR CLI - Command Line Interface and Agent Client for LOKTAR.
3
+ """
4
+
5
+ __version__ = "0.2.7"
@@ -41,7 +41,7 @@ class OAuthCallbackHandler(http.server.BaseHTTPRequestHandler):
41
41
  title="¡Autenticación Exitosa!",
42
42
  body="""
43
43
  <h2 style='color: #10B981;'>¡Autenticación Exitosa!</h2>
44
- <p>La CLI de <strong>LOCKTHARD</strong> ha sido conectada correctamente a tu cuenta.</p>
44
+ <p>La CLI de <strong>LOKTAR</strong> ha sido conectada correctamente a tu cuenta.</p>
45
45
  <p>Ya puedes cerrar esta ventana y regresar a tu terminal.</p>
46
46
  """
47
47
  )
@@ -129,7 +129,7 @@ def perform_browser_login(api_url: str, timeout_seconds: int = 120) -> Tuple[boo
129
129
  except Exception as e:
130
130
  return False, f"No se pudo iniciar el servidor local en el puerto {port}: {e}"
131
131
 
132
- print(f"Abriendo el navegador para autenticar en LOCKTHARD...")
132
+ print(f"Abriendo el navegador para autenticar en LOKTAR...")
133
133
  print(f"URL: {auth_url}\n")
134
134
  try:
135
135
  webbrowser.open(auth_url)
@@ -35,16 +35,16 @@ def _get_as_json(ctx: click.Context, local_flag: bool) -> bool:
35
35
 
36
36
 
37
37
  @click.group(invoke_without_command=False,
38
- epilog="Primer uso: lockthard skill | Para agentes: lockthard -j skill")
39
- @click.option("--url", "-u", default=None, help="Base URL del servidor LOCKTHARD (default: https://loktar.cc).")
38
+ epilog="Primer uso: loktar skill | Para agentes: loktar -j skill")
39
+ @click.option("--url", "-u", default=None, help="Base URL del servidor LOKTAR (default: https://loktar.cc).")
40
40
  @click.option("--token", "-t", default=None, help="API Key / Token de autenticación (lk_...).")
41
41
  @click.option("--json", "-j", "as_json", is_flag=True, help="Salida en JSON bruto (ideal para scripts y agentes).")
42
- @click.version_option(version=__version__, prog_name="lockthard")
42
+ @click.version_option(version=__version__, prog_name="loktar")
43
43
  @click.pass_context
44
44
  def cli(ctx: click.Context, url: Optional[str], token: Optional[str], as_json: bool):
45
- """LOCKTHARD CLI - Cliente super eficiente de herramientas IA para humanos y agentes.
45
+ """LOKTAR CLI - Cliente super eficiente de herramientas IA para humanos y agentes.
46
46
 
47
- Primer uso: lockthard skill | Para agentes: lockthard -j skill
47
+ Primer uso: loktar skill | Para agentes: loktar -j skill
48
48
  """
49
49
  resolved_url = resolve_api_url(url)
50
50
  resolved_token = resolve_token(token)
@@ -61,7 +61,7 @@ Primer uso: lockthard skill | Para agentes: lockthard -j skill
61
61
  help="Salida en JSON bruto (ideal para scripts y agentes).")
62
62
  @click.pass_context
63
63
  def ping(ctx: click.Context, as_json_local: bool):
64
- """Verifica la conectividad con el servidor de LOCKTHARD y el estado del token."""
64
+ """Verifica la conectividad con el servidor de LOKTAR y el estado del token."""
65
65
  client: LockthardClient = ctx.obj["client"]
66
66
  as_json = _get_as_json(ctx, as_json_local)
67
67
  try:
@@ -76,22 +76,22 @@ def ping(ctx: click.Context, as_json_local: bool):
76
76
  @click.option("--manual", "-m", is_flag=True, help="Modo interactivo en consola (sin abrir navegador).")
77
77
  @click.pass_context
78
78
  def login(ctx: click.Context, token: Optional[str], manual: bool):
79
- """Inicia sesión en LOCKTHARD (Browser OAuth, Token o Interactivo)."""
79
+ """Inicia sesión en LOKTAR (Browser OAuth, Token o Interactivo)."""
80
80
  api_url = ctx.obj["url"]
81
81
 
82
82
  # 1. Direct token via flag
83
83
  if token and token.strip():
84
84
  save_credentials(api_key=token.strip(), api_url=api_url)
85
- click.secho("✓ API Key guardada correctamente en ~/.lockthard/credentials.json", fg="green")
85
+ click.secho("✓ API Key guardada correctamente en ~/.loktar/credentials.json", fg="green")
86
86
  return
87
87
 
88
88
  # 2. Manual prompt via flag
89
89
  if manual:
90
- token_input = click.prompt("Pega tu API Key de LOCKTHARD (lk_...)", hide_input=True)
90
+ token_input = click.prompt("Pega tu API Key de LOKTAR (lk_...)", hide_input=True)
91
91
  if not token_input or not token_input.strip():
92
92
  _handle_error(LockthardError("Token vacío."))
93
93
  save_credentials(api_key=token_input.strip(), api_url=api_url)
94
- click.secho("✓ API Key guardada correctamente en ~/.lockthard/credentials.json", fg="green")
94
+ click.secho("✓ API Key guardada correctamente en ~/.loktar/credentials.json", fg="green")
95
95
  return
96
96
 
97
97
  # 3. Interactive Browser Login
@@ -101,14 +101,14 @@ def login(ctx: click.Context, token: Optional[str], manual: bool):
101
101
  click.secho(f"✓ {msg}", fg="green")
102
102
  else:
103
103
  click.secho(f"✗ {msg}", fg="yellow")
104
- click.echo("Puedes autenticarte manualmente con: lockthard login --token lk_tu_token")
104
+ click.echo("Puedes autenticarte manualmente con: loktar login --token lk_tu_token")
105
105
 
106
106
 
107
107
  @cli.command()
108
108
  def logout():
109
109
  """Cierra la sesión y elimina las credenciales locales."""
110
110
  if clear_credentials():
111
- click.secho("✓ Sesión cerrada y credenciales eliminadas (~/.lockthard/credentials.json).", fg="green")
111
+ click.secho("✓ Sesión cerrada y credenciales eliminadas (~/.loktar/credentials.json).", fg="green")
112
112
  else:
113
113
  click.echo("No había ninguna sesión activa guardada.")
114
114
 
@@ -121,7 +121,7 @@ def logout():
121
121
  @click.option("--limit", "-l", default=20, type=int, help="Límite de resultados (default: 20).")
122
122
  @click.pass_context
123
123
  def search(ctx: click.Context, as_json_local: bool, query: str, tablet: Optional[str], limit: int):
124
- """Busca herramientas por palabra clave en LOCKTHARD."""
124
+ """Busca herramientas por palabra clave en LOKTAR."""
125
125
  client: LockthardClient = ctx.obj["client"]
126
126
  as_json = _get_as_json(ctx, as_json_local)
127
127
  try:
@@ -133,7 +133,7 @@ def search(ctx: click.Context, as_json_local: bool, query: str, tablet: Optional
133
133
 
134
134
  @cli.group()
135
135
  def tablets():
136
- """Comandos para explorar las tablets de LOCKTHARD."""
136
+ """Comandos para explorar las tablets de LOKTAR."""
137
137
  pass
138
138
 
139
139
 
@@ -197,7 +197,7 @@ def get_tool_cmd(ctx: click.Context, as_json_local: bool, tool_id: str):
197
197
  help="Salida en JSON bruto (ideal para scripts y agentes).")
198
198
  @click.pass_context
199
199
  def cli_tools_cmd(ctx: click.Context, as_json_local: bool):
200
- """Lista las herramientas especializadas de línea de comandos en LOCKTHARD."""
200
+ """Lista las herramientas especializadas de línea de comandos en LOKTAR."""
201
201
  client: LockthardClient = ctx.obj["client"]
202
202
  as_json = _get_as_json(ctx, as_json_local)
203
203
  try:
@@ -5,25 +5,29 @@ from pathlib import Path
5
5
  from typing import Dict, Any, Optional
6
6
 
7
7
  DEFAULT_API_URL = "https://loktar.cc"
8
- CONFIG_DIR_NAME = ".lockthard"
8
+ CONFIG_DIR_NAME = ".loktar"
9
+ FALLBACK_CONFIG_DIR_NAME = ".lockthard"
9
10
  CREDENTIALS_FILE_NAME = "credentials.json"
10
11
 
11
12
 
12
13
  def get_config_dir() -> Path:
13
- """Return the configuration directory path (~/.lockthard)."""
14
+ """Return the configuration directory path (~/.loktar or fallback ~/.lockthard)."""
14
15
  home = Path.home()
15
- config_dir = home / CONFIG_DIR_NAME
16
- config_dir.mkdir(parents=True, exist_ok=True)
17
- return config_dir
16
+ primary = home / CONFIG_DIR_NAME
17
+ fallback = home / FALLBACK_CONFIG_DIR_NAME
18
+ if not primary.exists() and fallback.exists():
19
+ return fallback
20
+ primary.mkdir(parents=True, exist_ok=True)
21
+ return primary
18
22
 
19
23
 
20
24
  def get_credentials_path() -> Path:
21
- """Return the credentials file path (~/.lockthard/credentials.json)."""
25
+ """Return the credentials file path (~/.loktar/credentials.json)."""
22
26
  return get_config_dir() / CREDENTIALS_FILE_NAME
23
27
 
24
28
 
25
29
  def load_credentials() -> Dict[str, Any]:
26
- """Load credentials from ~/.lockthard/credentials.json if exists."""
30
+ """Load credentials from ~/.loktar/credentials.json if exists."""
27
31
  path = get_credentials_path()
28
32
  if not path.exists():
29
33
  return {}
@@ -36,7 +40,11 @@ def load_credentials() -> Dict[str, Any]:
36
40
 
37
41
  def save_credentials(api_key: str, email: Optional[str] = None, api_url: Optional[str] = None) -> Path:
38
42
  """Save credentials securely with restricted permissions (0600 on POSIX)."""
39
- path = get_credentials_path()
43
+ home = Path.home()
44
+ primary_dir = home / CONFIG_DIR_NAME
45
+ primary_dir.mkdir(parents=True, exist_ok=True)
46
+ path = primary_dir / CREDENTIALS_FILE_NAME
47
+
40
48
  data = load_credentials()
41
49
  data["api_key"] = api_key.strip()
42
50
  if email:
@@ -59,27 +67,30 @@ def save_credentials(api_key: str, email: Optional[str] = None, api_url: Optiona
59
67
 
60
68
  def clear_credentials() -> bool:
61
69
  """Remove the credentials file on logout."""
62
- path = get_credentials_path()
63
- if path.exists():
64
- try:
65
- path.unlink()
66
- return True
67
- except OSError:
68
- return False
69
- return False
70
+ removed = False
71
+ home = Path.home()
72
+ for dname in (CONFIG_DIR_NAME, FALLBACK_CONFIG_DIR_NAME):
73
+ path = home / dname / CREDENTIALS_FILE_NAME
74
+ if path.exists():
75
+ try:
76
+ path.unlink()
77
+ removed = True
78
+ except OSError:
79
+ pass
80
+ return removed
70
81
 
71
82
 
72
83
  def resolve_token(token_flag: Optional[str] = None) -> Optional[str]:
73
84
  """
74
85
  Resolve API key token in precedence order:
75
86
  1. Direct CLI argument / flag (--token)
76
- 2. Environment variable LOCKTHARD_API_KEY
77
- 3. Saved credentials (~/.lockthard/credentials.json)
87
+ 2. Environment variable LOKTAR_API_KEY (or LOCKTHARD_API_KEY)
88
+ 3. Saved credentials (~/.loktar/credentials.json or ~/.lockthard/credentials.json)
78
89
  """
79
90
  if token_flag and token_flag.strip():
80
91
  return token_flag.strip()
81
92
 
82
- env_token = os.environ.get("LOCKTHARD_API_KEY")
93
+ env_token = os.environ.get("LOKTAR_API_KEY") or os.environ.get("LOCKTHARD_API_KEY")
83
94
  if env_token and env_token.strip():
84
95
  return env_token.strip()
85
96
 
@@ -95,14 +106,14 @@ def resolve_api_url(url_flag: Optional[str] = None) -> str:
95
106
  """
96
107
  Resolve API Base URL in precedence order:
97
108
  1. Direct CLI argument / flag (--url)
98
- 2. Environment variable LOCKTHARD_API_URL
109
+ 2. Environment variable LOKTAR_API_URL (or LOCKTHARD_API_URL)
99
110
  3. Saved credentials api_url
100
111
  4. Default (https://loktar.cc)
101
112
  """
102
113
  if url_flag and url_flag.strip():
103
114
  return url_flag.strip().rstrip("/")
104
115
 
105
- env_url = os.environ.get("LOCKTHARD_API_URL")
116
+ env_url = os.environ.get("LOKTAR_API_URL") or os.environ.get("LOCKTHARD_API_URL")
106
117
  if env_url and env_url.strip():
107
118
  return env_url.strip().rstrip("/")
108
119
 
@@ -38,10 +38,10 @@ def print_ping_result(data: Dict[str, Any], as_json: bool = False):
38
38
 
39
39
  if HAS_RICH and console:
40
40
  if status == "ok" and auth:
41
- console.print("[bold green]✓ Servidor LOCKTHARD activo y token autenticado correctamente.[/bold green]")
41
+ console.print("[bold green]✓ Servidor LOKTAR activo y token autenticado correctamente.[/bold green]")
42
42
  elif status == "ok":
43
- console.print("[bold yellow]! Servidor LOCKTHARD activo (Sesión no autenticada).[/bold yellow]")
44
- console.print("[dim]Usa 'lockthard login' o exporta LOCKTHARD_API_KEY para autenticar.[/dim]")
43
+ console.print("[bold yellow]! Servidor LOKTAR activo (Sesión no autenticada).[/bold yellow]")
44
+ console.print("[dim]Usa 'loktar login' o exporta LOKTAR_API_KEY para autenticar.[/dim]")
45
45
  else:
46
46
  console.print(f"[bold red]✗ Error de conexión: {data.get('error', 'Desconocido')}[/bold red]")
47
47
  else:
@@ -58,7 +58,7 @@ def print_tablets_list(tablets: List[Dict[str, Any]], as_json: bool = False):
58
58
  return
59
59
 
60
60
  if HAS_RICH and console:
61
- table = Table(title=f"LOCKTHARD Tablets ({len(tablets)})", show_header=True, header_style="bold magenta")
61
+ table = Table(title=f"LOKTAR Tablets ({len(tablets)})", show_header=True, header_style="bold magenta")
62
62
  table.add_column("ID / Slug", style="cyan", no_wrap=True)
63
63
  table.add_column("Título", style="bold white")
64
64
  table.add_column("Categoría", style="yellow")
@@ -216,16 +216,16 @@ def print_cli_tools(tools: List[Dict[str, Any]], as_json: bool = False):
216
216
 
217
217
  def print_agent_guide():
218
218
  guide_md = """
219
- # LOCKTHARD CLI - Guía para Agentes de IA
219
+ # LOKTAR CLI - Guía para Agentes de IA
220
220
 
221
- Bienvenido a la CLI de **LOCKTHARD**. Esta interfaz permite a Agentes de IA (Claude Code, Antigravity, Aider, Cursor) consultar la base de datos de 1200+ herramientas IA con mínimo consumo de tokens.
221
+ Bienvenido a la CLI de **LOKTAR**. Esta interfaz permite a Agentes de IA (Claude Code, Antigravity, Aider, Cursor) consultar la base de datos de 1200+ herramientas IA con mínimo consumo de tokens.
222
222
 
223
223
  ## SKILL Completa
224
224
 
225
225
  Para obtener la guía completa optimizada para agentes, ejecuta:
226
226
 
227
227
  ```bash
228
- lockthard skill
228
+ loktar skill
229
229
  ```
230
230
 
231
231
  Esto imprime la SKILL.md con toda la referencia: comandos, estructura de tablets, flujo de trabajo y ejemplos.
@@ -235,21 +235,21 @@ Esto imprime la SKILL.md con toda la referencia: comandos, estructura de tablets
235
235
  1. **Usa el flag `-j` (posicion global o en subcommand):**
236
236
  Devuelve datos limpios y estructurados en JSON.
237
237
  ```bash
238
- lockthard -j search "ocr"
239
- lockthard tablets list -j
238
+ loktar -j search "ocr"
239
+ loktar tablets list -j
240
240
  ```
241
241
 
242
242
  2. **Flujo de Trabajo Recomendado:**
243
- - `lockthard ping`: Verificar conexión y autenticación.
244
- - `lockthard tablets list`: Ver todos los tablets y categorías disponibles.
245
- - `lockthard search "<termino>"`: Buscar herramientas por palabras clave.
246
- - `lockthard tablets get <id>`: Obtener todas las herramientas de un tablet específico.
247
- - `lockthard tools get "<nombre>"`: Ver detalles y comandos exactos de una herramienta.
243
+ - `loktar ping`: Verificar conexión y autenticación.
244
+ - `loktar tablets list`: Ver todos los tablets y categorías disponibles.
245
+ - `loktar search "<termino>"`: Buscar herramientas por palabras clave.
246
+ - `loktar tablets get <id>`: Obtener todas las herramientas de un tablet específico.
247
+ - `loktar tools get "<nombre>"`: Ver detalles y comandos exactos de una herramienta.
248
248
 
249
249
  3. **Autenticación en Agentes:**
250
- Define la variable de entorno `LOCKTHARD_API_KEY`:
250
+ Define la variable de entorno `LOKTAR_API_KEY`:
251
251
  ```bash
252
- export LOCKTHARD_API_KEY="lk_tu_token_aqui"
252
+ export LOKTAR_API_KEY="lk_tu_token_aqui"
253
253
  ```
254
254
  """
255
255
  if HAS_RICH and console:
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lockthard-cli
3
- Version: 0.2.6
4
- Summary: CLI and AI agent client for LOCKTHARD — query 2100+ curated AI tools across 86+ tablets
5
- Author-email: Lockthard Team <info@loktar.cc>
3
+ Version: 0.2.7
4
+ Summary: CLI and AI agent client for LOKTAR — query 2100+ curated AI tools across 86+ tablets
5
+ Author-email: Loktar Team <info@loktar.cc>
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://loktar.cc
8
- Keywords: cli,ai-tools,agents,mcp,lockthard
8
+ Keywords: cli,ai-tools,agents,mcp,loktar,lockthard
9
9
  Classifier: Development Status :: 4 - Beta
10
10
  Classifier: Environment :: Console
11
11
  Classifier: Intended Audience :: Developers
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
2
  lockthard = lockthard_cli.cli:main
3
+ loktar = lockthard_cli.cli:main
@@ -4,15 +4,15 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "lockthard-cli"
7
- version = "0.2.6"
8
- description = "CLI and AI agent client for LOCKTHARD — query 2100+ curated AI tools across 86+ tablets"
7
+ version = "0.2.7"
8
+ description = "CLI and AI agent client for LOKTAR — query 2100+ curated AI tools across 86+ tablets"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
11
11
  requires-python = ">=3.10"
12
12
  authors = [
13
- { name = "Lockthard Team", email = "info@loktar.cc" }
13
+ { name = "Loktar Team", email = "info@loktar.cc" }
14
14
  ]
15
- keywords = ["cli", "ai-tools", "agents", "mcp", "lockthard"]
15
+ keywords = ["cli", "ai-tools", "agents", "mcp", "loktar", "lockthard"]
16
16
  classifiers = [
17
17
  "Development Status :: 4 - Beta",
18
18
  "Environment :: Console",
@@ -33,6 +33,7 @@ dependencies = [
33
33
  Homepage = "https://loktar.cc"
34
34
 
35
35
  [project.scripts]
36
+ loktar = "lockthard_cli.cli:main"
36
37
  lockthard = "lockthard_cli.cli:main"
37
38
 
38
39
  [tool.setuptools.packages.find]
@@ -1,5 +0,0 @@
1
- """
2
- LOCKTHARD CLI - Command Line Interface and Agent Client for LOCKTHARD.
3
- """
4
-
5
- __version__ = "0.2.6"
File without changes
File without changes