agenticstackfile 0.1.3__tar.gz → 0.2.1__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.
Files changed (34) hide show
  1. agenticstackfile-0.2.1/PKG-INFO +109 -0
  2. agenticstackfile-0.2.1/README.md +91 -0
  3. agenticstackfile-0.2.1/agenticstack/cli.py +110 -0
  4. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/config.py +9 -5
  5. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/core.py +1 -1
  6. agenticstackfile-0.2.1/agenticstack/scheduler.py +41 -0
  7. agenticstackfile-0.2.1/agenticstack/watcher.py +64 -0
  8. agenticstackfile-0.2.1/agenticstack/writer.py +23 -0
  9. agenticstackfile-0.2.1/agenticstackfile.egg-info/PKG-INFO +109 -0
  10. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstackfile.egg-info/SOURCES.txt +2 -0
  11. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstackfile.egg-info/requires.txt +1 -0
  12. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/pyproject.toml +2 -2
  13. agenticstackfile-0.1.3/PKG-INFO +0 -72
  14. agenticstackfile-0.1.3/README.md +0 -55
  15. agenticstackfile-0.1.3/agenticstack/cli.py +0 -45
  16. agenticstackfile-0.1.3/agenticstack/writer.py +0 -5
  17. agenticstackfile-0.1.3/agenticstackfile.egg-info/PKG-INFO +0 -72
  18. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/__init__.py +0 -0
  19. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/analyzer/__init__.py +0 -0
  20. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/analyzer/base.py +0 -0
  21. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/analyzer/python.py +0 -0
  22. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/errors.py +0 -0
  23. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/formatter/__init__.py +0 -0
  24. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/formatter/static.py +0 -0
  25. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/prompt.py +0 -0
  26. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/providers/__init__.py +0 -0
  27. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/providers/anthropic.py +0 -0
  28. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/providers/base.py +0 -0
  29. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/providers/factory.py +0 -0
  30. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstack/providers/openai.py +0 -0
  31. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstackfile.egg-info/dependency_links.txt +0 -0
  32. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstackfile.egg-info/entry_points.txt +0 -0
  33. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/agenticstackfile.egg-info/top_level.txt +0 -0
  34. {agenticstackfile-0.1.3 → agenticstackfile-0.2.1}/setup.cfg +0 -0
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.4
2
+ Name: agenticstackfile
3
+ Version: 0.2.1
4
+ Summary: Instant codebase map for AI agents — understand any project before making changes
5
+ Author-email: Rajat Handa <handarajat111@gmail.com>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.9
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: click>=8.0.0
10
+ Provides-Extra: anthropic
11
+ Requires-Dist: anthropic>=0.20.0; extra == "anthropic"
12
+ Provides-Extra: openai
13
+ Requires-Dist: openai>=1.0.0; extra == "openai"
14
+ Provides-Extra: all
15
+ Requires-Dist: anthropic>=0.20.0; extra == "all"
16
+ Requires-Dist: openai>=1.0.0; extra == "all"
17
+ Requires-Dist: watchdog>=3.0.0; extra == "all"
18
+
19
+ # AgenticStack
20
+
21
+ Instant codebase map for AI agents — understand any Python project before making changes.
22
+
23
+ ## What it does
24
+
25
+ AgenticStack analyzes your Python project and generates `AgenticStack.txt` — a structured file that tells any AI agent:
26
+
27
+ - Where every model, view, serializer, service, and utility lives
28
+ - Which files to touch when making a specific change
29
+ - How your project is structured by framework (Django, Flask, FastAPI, or plain Python)
30
+ - A step-by-step change guide using your actual file paths
31
+
32
+ ## Installation
33
+
34
+ ```bash
35
+ pip install agenticstackfile
36
+ ```
37
+
38
+ With AI support:
39
+
40
+ ```bash
41
+ pip install 'agenticstackfile[anthropic]'
42
+ pip install 'agenticstackfile[openai]'
43
+ ```
44
+
45
+ With auto-sync (watch mode):
46
+
47
+ ```bash
48
+ pip install 'agenticstackfile[watch]'
49
+ ```
50
+
51
+ Everything at once:
52
+
53
+ ```bash
54
+ pip install 'agenticstackfile[all]'
55
+ ```
56
+
57
+ ## Usage
58
+
59
+ ```bash
60
+ agenticstack init # First-time setup — creates config and ignore file
61
+ agenticstack update # Manually refresh AgenticStack.txt
62
+ agenticstack watch # Auto-sync mode — watches for file changes and syncs automatically
63
+ ```
64
+
65
+ ## Auto-sync (Watch Mode)
66
+
67
+ `agenticstack watch` runs two background services:
68
+
69
+ - **Watcher** — monitors your project for file changes in real time
70
+ - **Scheduler** — syncs `AgenticStack.txt` automatically based on your configured interval
71
+
72
+ Only syncs when files have actually changed — no wasted API tokens.
73
+
74
+ Requires `watchdog`: `pip install 'agenticstackfile[watch]'`
75
+
76
+ ## Modes
77
+
78
+ **Static mode** — no API key needed. Uses Python AST to map your codebase for free.
79
+
80
+ **AI mode** — provide an API key and Claude or GPT generates rich, detailed documentation with change guides tailored to your framework.
81
+
82
+ ## Configuration
83
+
84
+ Edit `.agenticstack.ini` in your project root:
85
+
86
+ ```ini
87
+ [agenticstack]
88
+ provider = anthropic
89
+ model = default
90
+ api_key = YOUR_API_KEY
91
+ output_file = AgenticStack.txt
92
+ depth = standard
93
+ sync_trigger = false
94
+ sync_time = hourly
95
+ ```
96
+
97
+ | Key | Values | Description |
98
+ |---|---|---|
99
+ | `provider` | `anthropic`, `openai` | AI provider to use |
100
+ | `model` | `default`, or model name | Model to use. `default` picks the best available. |
101
+ | `api_key` | your key | API key for AI mode |
102
+ | `output_file` | filename | Output file name |
103
+ | `depth` | `standard` | Analysis depth |
104
+ | `sync_trigger` | `true`, `false` | Enable auto-sync in watch mode |
105
+ | `sync_time` | `realtime`, `hourly`, `daily` | How often to sync when changes are detected |
106
+
107
+ ## Ignoring Files
108
+
109
+ Create `.agenticstackignore` in your project root (auto-created by `agenticstack init`):
@@ -0,0 +1,91 @@
1
+ # AgenticStack
2
+
3
+ Instant codebase map for AI agents — understand any Python project before making changes.
4
+
5
+ ## What it does
6
+
7
+ AgenticStack analyzes your Python project and generates `AgenticStack.txt` — a structured file that tells any AI agent:
8
+
9
+ - Where every model, view, serializer, service, and utility lives
10
+ - Which files to touch when making a specific change
11
+ - How your project is structured by framework (Django, Flask, FastAPI, or plain Python)
12
+ - A step-by-step change guide using your actual file paths
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ pip install agenticstackfile
18
+ ```
19
+
20
+ With AI support:
21
+
22
+ ```bash
23
+ pip install 'agenticstackfile[anthropic]'
24
+ pip install 'agenticstackfile[openai]'
25
+ ```
26
+
27
+ With auto-sync (watch mode):
28
+
29
+ ```bash
30
+ pip install 'agenticstackfile[watch]'
31
+ ```
32
+
33
+ Everything at once:
34
+
35
+ ```bash
36
+ pip install 'agenticstackfile[all]'
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ```bash
42
+ agenticstack init # First-time setup — creates config and ignore file
43
+ agenticstack update # Manually refresh AgenticStack.txt
44
+ agenticstack watch # Auto-sync mode — watches for file changes and syncs automatically
45
+ ```
46
+
47
+ ## Auto-sync (Watch Mode)
48
+
49
+ `agenticstack watch` runs two background services:
50
+
51
+ - **Watcher** — monitors your project for file changes in real time
52
+ - **Scheduler** — syncs `AgenticStack.txt` automatically based on your configured interval
53
+
54
+ Only syncs when files have actually changed — no wasted API tokens.
55
+
56
+ Requires `watchdog`: `pip install 'agenticstackfile[watch]'`
57
+
58
+ ## Modes
59
+
60
+ **Static mode** — no API key needed. Uses Python AST to map your codebase for free.
61
+
62
+ **AI mode** — provide an API key and Claude or GPT generates rich, detailed documentation with change guides tailored to your framework.
63
+
64
+ ## Configuration
65
+
66
+ Edit `.agenticstack.ini` in your project root:
67
+
68
+ ```ini
69
+ [agenticstack]
70
+ provider = anthropic
71
+ model = default
72
+ api_key = YOUR_API_KEY
73
+ output_file = AgenticStack.txt
74
+ depth = standard
75
+ sync_trigger = false
76
+ sync_time = hourly
77
+ ```
78
+
79
+ | Key | Values | Description |
80
+ |---|---|---|
81
+ | `provider` | `anthropic`, `openai` | AI provider to use |
82
+ | `model` | `default`, or model name | Model to use. `default` picks the best available. |
83
+ | `api_key` | your key | API key for AI mode |
84
+ | `output_file` | filename | Output file name |
85
+ | `depth` | `standard` | Analysis depth |
86
+ | `sync_trigger` | `true`, `false` | Enable auto-sync in watch mode |
87
+ | `sync_time` | `realtime`, `hourly`, `daily` | How often to sync when changes are detected |
88
+
89
+ ## Ignoring Files
90
+
91
+ Create `.agenticstackignore` in your project root (auto-created by `agenticstack init`):
@@ -0,0 +1,110 @@
1
+ import click
2
+ from pathlib import Path
3
+ from datetime import datetime
4
+ from .config import create_default_config, config_exists, write_config, read_config, create_default_ignore_file
5
+ from .core import run
6
+
7
+
8
+ def _check_staleness(config: dict) -> None:
9
+ output_file = Path(config.get("output_file", "AgenticStack.txt"))
10
+ if not output_file.exists():
11
+ return
12
+ age_seconds = (datetime.now() - datetime.fromtimestamp(output_file.stat().st_mtime)).total_seconds()
13
+ thresholds = {"realtime": 300, "hourly": 3600, "daily": 86400}
14
+ sync_time = config.get("sync_time", "false")
15
+ threshold = thresholds.get(sync_time)
16
+ if threshold and age_seconds > threshold:
17
+ hours = int(age_seconds // 3600)
18
+ minutes = int((age_seconds % 3600) // 60)
19
+ click.echo(f"WARNING: AgenticStack.txt was last updated {hours}h {minutes}m ago. Consider running 'agenticstack update'.")
20
+
21
+
22
+ def _start_background_services(config: dict, root_path: Path) -> None:
23
+ if config.get("sync_trigger", "false").lower() != "true":
24
+ return
25
+ sync_time = config.get("sync_time", "hourly")
26
+ try:
27
+ from .watcher import start_watcher
28
+ from .scheduler import start_scheduler
29
+ start_watcher(root_path)
30
+ start_scheduler(root_path, sync_time)
31
+ click.echo(f"AgenticStack: Auto sync enabled ({sync_time})")
32
+ except ImportError as e:
33
+ click.echo(f"WARNING: {e}")
34
+
35
+
36
+ @click.group()
37
+ def main():
38
+ """AgenticStack — instant codebase map for AI agents."""
39
+ pass
40
+
41
+
42
+ @main.command()
43
+ @click.option("--api-key", default=None, help="Your LLM provider API key")
44
+ @click.option("--provider", default=None, help="Provider: anthropic or openai")
45
+ @click.option("--model", default=None, help="Model: default, fast, or smart")
46
+ def init(api_key, provider, model):
47
+ """Initialize AgenticStack in this project."""
48
+ if config_exists():
49
+ click.echo("AgenticStack: Config already exists. Use 'agenticstack update' to refresh.")
50
+ return
51
+
52
+ create_default_config()
53
+ click.echo("AgenticStack: Created .agenticstack.ini")
54
+ create_default_ignore_file()
55
+ click.echo("AgenticStack: Created .agenticstackignore")
56
+
57
+ if api_key:
58
+ write_config("api_key", api_key)
59
+ if provider:
60
+ write_config("provider", provider)
61
+ if model:
62
+ write_config("model", model)
63
+
64
+ config = read_config()
65
+ _start_background_services(config, Path.cwd())
66
+ run(Path.cwd())
67
+
68
+
69
+ @main.command()
70
+ def update():
71
+ """Refresh AgenticStack.txt for this project."""
72
+ if not config_exists():
73
+ click.echo("AgenticStack: No config found. Run 'agenticstack init' first.")
74
+ return
75
+
76
+ config = read_config()
77
+ _check_staleness(config)
78
+ _start_background_services(config, Path.cwd())
79
+ run(Path.cwd())
80
+
81
+
82
+ @main.command()
83
+ def watch():
84
+ """Watch for file changes and auto sync AgenticStack.txt."""
85
+ if not config_exists():
86
+ click.echo("AgenticStack: No config found. Run 'agenticstack init' first.")
87
+ return
88
+
89
+ config = read_config()
90
+ sync_time = config.get("sync_time", "hourly")
91
+ root_path = Path.cwd()
92
+
93
+ try:
94
+ from .watcher import start_watcher
95
+ from .scheduler import start_scheduler
96
+ import time
97
+
98
+ start_watcher(root_path)
99
+ start_scheduler(root_path, sync_time)
100
+
101
+ click.echo(f"AgenticStack: Watching for changes ({sync_time} sync)...")
102
+ click.echo("Press Ctrl+C to stop.")
103
+
104
+ while True:
105
+ time.sleep(1)
106
+
107
+ except ImportError as e:
108
+ click.echo(f"ERROR: {e}")
109
+ except KeyboardInterrupt:
110
+ click.echo("\nAgenticStack: Watch stopped.")
@@ -11,6 +11,8 @@ DEFAULTS = {
11
11
  "language": "auto",
12
12
  "output_file": "AgenticStack.txt",
13
13
  "depth": "standard",
14
+ "sync_trigger": "false",
15
+ "sync_time": "hourly",
14
16
  }
15
17
 
16
18
 
@@ -50,16 +52,18 @@ def write_config(key: str, value: str) -> None:
50
52
 
51
53
  def _add_to_gitignore() -> None:
52
54
  gitignore_path = Path.cwd() / ".gitignore"
53
- entry = CONFIG_FILE
55
+ entries = [CONFIG_FILE, ".agenticstack_pending"]
54
56
 
55
57
  if gitignore_path.exists():
56
58
  content = gitignore_path.read_text()
57
- if entry not in content:
58
- with open(gitignore_path, "a") as f:
59
- f.write(f"\n{entry}\n")
59
+ with open(gitignore_path, "a") as f:
60
+ for entry in entries:
61
+ if entry not in content:
62
+ f.write(f"\n{entry}\n")
60
63
  else:
61
64
  with open(gitignore_path, "w") as f:
62
- f.write(f"{entry}\n")
65
+ for entry in entries:
66
+ f.write(f"{entry}\n")
63
67
 
64
68
 
65
69
  def create_default_ignore_file() -> None:
@@ -50,5 +50,5 @@ def run(root_path: Path = None) -> None:
50
50
  final_output = static_output
51
51
 
52
52
  output_file = config.get("output_file", "AgenticStack.txt")
53
- write_output(final_output, Path(output_file))
53
+ write_output(final_output, Path(output_file), sync_time=config.get("sync_time", "false"))
54
54
  print(f"AgenticStack: Done. Output written to {output_file}")
@@ -0,0 +1,41 @@
1
+ import threading
2
+ from pathlib import Path
3
+
4
+
5
+ SYNC_INTERVALS = {
6
+ "realtime": 300,
7
+ "hourly": 3600,
8
+ "daily": 86400,
9
+ }
10
+
11
+
12
+ def start_scheduler(root_path: Path, sync_time: str) -> None:
13
+ interval = SYNC_INTERVALS.get(sync_time)
14
+
15
+ if not interval:
16
+ print(f"AgenticStack: Scheduler — unknown sync_time '{sync_time}', skipping.")
17
+ return
18
+
19
+ print(f"AgenticStack: Scheduler started — will sync every {interval} seconds.")
20
+
21
+ def sync_loop():
22
+ from .watcher import has_pending_changes, clear_pending
23
+ from .core import run
24
+
25
+ print("AgenticStack: Scheduler tick — checking for pending changes...")
26
+
27
+ if has_pending_changes(root_path):
28
+ print("AgenticStack: Pending changes detected — syncing...")
29
+ clear_pending(root_path)
30
+ run(root_path)
31
+ print("AgenticStack: Sync complete.")
32
+ else:
33
+ print("AgenticStack: No pending changes — skipping.")
34
+
35
+ timer = threading.Timer(interval, sync_loop)
36
+ timer.daemon = True
37
+ timer.start()
38
+
39
+ timer = threading.Timer(interval, sync_loop)
40
+ timer.daemon = True
41
+ timer.start()
@@ -0,0 +1,64 @@
1
+ from pathlib import Path
2
+ from datetime import datetime
3
+
4
+
5
+ PENDING_FILE = ".agenticstack_pending"
6
+
7
+
8
+ def record_change(filepath: str, root_path: Path) -> None:
9
+ pending_path = root_path / PENDING_FILE
10
+ timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
11
+ with open(pending_path, "a") as f:
12
+ f.write(f"{timestamp} | {filepath}\n")
13
+
14
+
15
+ def has_pending_changes(root_path: Path) -> bool:
16
+ pending_path = root_path / PENDING_FILE
17
+ if not pending_path.exists():
18
+ return False
19
+ return pending_path.read_text().strip() != ""
20
+
21
+
22
+ def clear_pending(root_path: Path) -> None:
23
+ pending_path = root_path / PENDING_FILE
24
+ if pending_path.exists():
25
+ pending_path.write_text("")
26
+
27
+
28
+ def start_watcher(root_path: Path) -> None:
29
+ try:
30
+ from watchdog.observers import Observer
31
+ from watchdog.events import FileSystemEventHandler
32
+ IGNORE_FILES = {
33
+ ".agenticstack_pending",
34
+ ".agenticstack.ini",
35
+ "AgenticStack.txt",
36
+ ".agenticstackignore",
37
+ }
38
+
39
+ class ChangeHandler(FileSystemEventHandler):
40
+ def _should_ignore(self, path: str) -> bool:
41
+ filename = Path(path).name
42
+ return filename in IGNORE_FILES
43
+
44
+ def on_modified(self, event):
45
+ if not event.is_directory and not self._should_ignore(event.src_path):
46
+ record_change(event.src_path, root_path)
47
+ print(f"AgenticStack: Change detected — {event.src_path}")
48
+
49
+ def on_created(self, event):
50
+ if not event.is_directory and not self._should_ignore(event.src_path):
51
+ record_change(event.src_path, root_path)
52
+ print(f"AgenticStack: New file detected — {event.src_path}")
53
+
54
+ observer = Observer()
55
+ observer.schedule(ChangeHandler(), str(root_path), recursive=True)
56
+ observer.daemon = True
57
+ observer.start()
58
+ print(f"AgenticStack: Watcher started on {root_path}")
59
+
60
+ except ImportError:
61
+ raise ImportError(
62
+ "watchdog not installed. "
63
+ "Run: pip install 'agenticstackfile[watch]'"
64
+ )
@@ -0,0 +1,23 @@
1
+ from pathlib import Path
2
+ from datetime import datetime
3
+
4
+ SYNC_INTERVALS = {
5
+ "realtime": "every 2 minutes",
6
+ "hourly": "every 1 hour",
7
+ "daily": "every 24 hours",
8
+ "false": "manual only",
9
+ }
10
+
11
+ def write_output(content: str, output_path: Path, sync_time: str = "false") -> None:
12
+ now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
13
+ sync_label = SYNC_INTERVALS.get(sync_time, "manual only")
14
+
15
+ header = f"""============================================================
16
+ AGENTICSTACK — CODEBASE MAP
17
+ Generated: {now}
18
+ Auto sync: {sync_label}
19
+ WARNING: Run 'agenticstack update' to force refresh anytime
20
+ ============================================================
21
+
22
+ """
23
+ output_path.write_text(header + content, encoding="utf-8")
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.4
2
+ Name: agenticstackfile
3
+ Version: 0.2.1
4
+ Summary: Instant codebase map for AI agents — understand any project before making changes
5
+ Author-email: Rajat Handa <handarajat111@gmail.com>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.9
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: click>=8.0.0
10
+ Provides-Extra: anthropic
11
+ Requires-Dist: anthropic>=0.20.0; extra == "anthropic"
12
+ Provides-Extra: openai
13
+ Requires-Dist: openai>=1.0.0; extra == "openai"
14
+ Provides-Extra: all
15
+ Requires-Dist: anthropic>=0.20.0; extra == "all"
16
+ Requires-Dist: openai>=1.0.0; extra == "all"
17
+ Requires-Dist: watchdog>=3.0.0; extra == "all"
18
+
19
+ # AgenticStack
20
+
21
+ Instant codebase map for AI agents — understand any Python project before making changes.
22
+
23
+ ## What it does
24
+
25
+ AgenticStack analyzes your Python project and generates `AgenticStack.txt` — a structured file that tells any AI agent:
26
+
27
+ - Where every model, view, serializer, service, and utility lives
28
+ - Which files to touch when making a specific change
29
+ - How your project is structured by framework (Django, Flask, FastAPI, or plain Python)
30
+ - A step-by-step change guide using your actual file paths
31
+
32
+ ## Installation
33
+
34
+ ```bash
35
+ pip install agenticstackfile
36
+ ```
37
+
38
+ With AI support:
39
+
40
+ ```bash
41
+ pip install 'agenticstackfile[anthropic]'
42
+ pip install 'agenticstackfile[openai]'
43
+ ```
44
+
45
+ With auto-sync (watch mode):
46
+
47
+ ```bash
48
+ pip install 'agenticstackfile[watch]'
49
+ ```
50
+
51
+ Everything at once:
52
+
53
+ ```bash
54
+ pip install 'agenticstackfile[all]'
55
+ ```
56
+
57
+ ## Usage
58
+
59
+ ```bash
60
+ agenticstack init # First-time setup — creates config and ignore file
61
+ agenticstack update # Manually refresh AgenticStack.txt
62
+ agenticstack watch # Auto-sync mode — watches for file changes and syncs automatically
63
+ ```
64
+
65
+ ## Auto-sync (Watch Mode)
66
+
67
+ `agenticstack watch` runs two background services:
68
+
69
+ - **Watcher** — monitors your project for file changes in real time
70
+ - **Scheduler** — syncs `AgenticStack.txt` automatically based on your configured interval
71
+
72
+ Only syncs when files have actually changed — no wasted API tokens.
73
+
74
+ Requires `watchdog`: `pip install 'agenticstackfile[watch]'`
75
+
76
+ ## Modes
77
+
78
+ **Static mode** — no API key needed. Uses Python AST to map your codebase for free.
79
+
80
+ **AI mode** — provide an API key and Claude or GPT generates rich, detailed documentation with change guides tailored to your framework.
81
+
82
+ ## Configuration
83
+
84
+ Edit `.agenticstack.ini` in your project root:
85
+
86
+ ```ini
87
+ [agenticstack]
88
+ provider = anthropic
89
+ model = default
90
+ api_key = YOUR_API_KEY
91
+ output_file = AgenticStack.txt
92
+ depth = standard
93
+ sync_trigger = false
94
+ sync_time = hourly
95
+ ```
96
+
97
+ | Key | Values | Description |
98
+ |---|---|---|
99
+ | `provider` | `anthropic`, `openai` | AI provider to use |
100
+ | `model` | `default`, or model name | Model to use. `default` picks the best available. |
101
+ | `api_key` | your key | API key for AI mode |
102
+ | `output_file` | filename | Output file name |
103
+ | `depth` | `standard` | Analysis depth |
104
+ | `sync_trigger` | `true`, `false` | Enable auto-sync in watch mode |
105
+ | `sync_time` | `realtime`, `hourly`, `daily` | How often to sync when changes are detected |
106
+
107
+ ## Ignoring Files
108
+
109
+ Create `.agenticstackignore` in your project root (auto-created by `agenticstack init`):
@@ -6,6 +6,8 @@ agenticstack/config.py
6
6
  agenticstack/core.py
7
7
  agenticstack/errors.py
8
8
  agenticstack/prompt.py
9
+ agenticstack/scheduler.py
10
+ agenticstack/watcher.py
9
11
  agenticstack/writer.py
10
12
  agenticstack/analyzer/__init__.py
11
13
  agenticstack/analyzer/base.py
@@ -3,6 +3,7 @@ click>=8.0.0
3
3
  [all]
4
4
  anthropic>=0.20.0
5
5
  openai>=1.0.0
6
+ watchdog>=3.0.0
6
7
 
7
8
  [anthropic]
8
9
  anthropic>=0.20.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "agenticstackfile"
7
- version = "0.1.3"
7
+ version = "0.2.1"
8
8
  description = "Instant codebase map for AI agents — understand any project before making changes"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -19,7 +19,7 @@ dependencies = [
19
19
  [project.optional-dependencies]
20
20
  anthropic = ["anthropic>=0.20.0"]
21
21
  openai = ["openai>=1.0.0"]
22
- all = ["anthropic>=0.20.0", "openai>=1.0.0"]
22
+ all = ["anthropic>=0.20.0", "openai>=1.0.0", "watchdog>=3.0.0"]
23
23
 
24
24
  [project.scripts]
25
25
  agenticstack = "agenticstack.cli:main"
@@ -1,72 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: agenticstackfile
3
- Version: 0.1.3
4
- Summary: Instant codebase map for AI agents — understand any project before making changes
5
- Author-email: Rajat Handa <handarajat111@gmail.com>
6
- License-Expression: MIT
7
- Requires-Python: >=3.9
8
- Description-Content-Type: text/markdown
9
- Requires-Dist: click>=8.0.0
10
- Provides-Extra: anthropic
11
- Requires-Dist: anthropic>=0.20.0; extra == "anthropic"
12
- Provides-Extra: openai
13
- Requires-Dist: openai>=1.0.0; extra == "openai"
14
- Provides-Extra: all
15
- Requires-Dist: anthropic>=0.20.0; extra == "all"
16
- Requires-Dist: openai>=1.0.0; extra == "all"
17
-
18
- # AgenticStack
19
-
20
- Instant codebase map for AI agents — understand any project before making changes.
21
-
22
- ## What it does
23
-
24
- AgenticStack analyzes your Python project and generates `AgenticStack.txt` — a structured file that tells any AI agent:
25
-
26
- - Where every model, view, serializer, and service lives
27
- - Which files to touch when making a specific change
28
- - Which models are exposed via API vs internal only
29
- - Step by step how-to guides using your actual file paths
30
-
31
- ## Installation
32
-
33
- ```bash
34
- pip install agenticstackfile
35
- ```
36
-
37
- With AI support:
38
-
39
- ```bash
40
- pip install 'agenticstackfile[openai]'
41
- pip install 'agenticstackfile[anthropic]'
42
- ```
43
-
44
- ## Usage
45
-
46
- ```bash
47
- agenticstack init # First time setup
48
- agenticstack update # Refresh AgenticStack.txt
49
- ```
50
-
51
- ## Modes
52
-
53
- **Static mode** — no API key needed. Uses Python AST to analyze your codebase for free.
54
-
55
- **AI mode** — provide an API key and Claude or GPT generates rich, detailed documentation.
56
-
57
- ## Configuration
58
-
59
- Edit `.agenticstack.ini` in your project root:
60
-
61
- ```ini
62
- [agenticstack]
63
- model = default
64
- api_key = YOUR_API_KEY
65
- provider = anthropic
66
- output_file = AgenticStack.txt
67
- ```
68
-
69
- ## Supported providers
70
-
71
- - `anthropic` — Claude Sonnet, Haiku, Opus
72
- - `openai` — GPT-4o, GPT-4o-mini
@@ -1,55 +0,0 @@
1
- # AgenticStack
2
-
3
- Instant codebase map for AI agents — understand any project before making changes.
4
-
5
- ## What it does
6
-
7
- AgenticStack analyzes your Python project and generates `AgenticStack.txt` — a structured file that tells any AI agent:
8
-
9
- - Where every model, view, serializer, and service lives
10
- - Which files to touch when making a specific change
11
- - Which models are exposed via API vs internal only
12
- - Step by step how-to guides using your actual file paths
13
-
14
- ## Installation
15
-
16
- ```bash
17
- pip install agenticstackfile
18
- ```
19
-
20
- With AI support:
21
-
22
- ```bash
23
- pip install 'agenticstackfile[openai]'
24
- pip install 'agenticstackfile[anthropic]'
25
- ```
26
-
27
- ## Usage
28
-
29
- ```bash
30
- agenticstack init # First time setup
31
- agenticstack update # Refresh AgenticStack.txt
32
- ```
33
-
34
- ## Modes
35
-
36
- **Static mode** — no API key needed. Uses Python AST to analyze your codebase for free.
37
-
38
- **AI mode** — provide an API key and Claude or GPT generates rich, detailed documentation.
39
-
40
- ## Configuration
41
-
42
- Edit `.agenticstack.ini` in your project root:
43
-
44
- ```ini
45
- [agenticstack]
46
- model = default
47
- api_key = YOUR_API_KEY
48
- provider = anthropic
49
- output_file = AgenticStack.txt
50
- ```
51
-
52
- ## Supported providers
53
-
54
- - `anthropic` — Claude Sonnet, Haiku, Opus
55
- - `openai` — GPT-4o, GPT-4o-mini
@@ -1,45 +0,0 @@
1
- import click
2
- from pathlib import Path
3
- from .config import create_default_config, config_exists, write_config, read_config, create_default_ignore_file
4
- from .core import run
5
-
6
-
7
- @click.group()
8
- def main():
9
- """AgenticStack — instant codebase map for AI agents."""
10
- pass
11
-
12
-
13
- @main.command()
14
- @click.option("--api-key", default=None, help="Your LLM provider API key")
15
- @click.option("--provider", default=None, help="Provider: anthropic or openai")
16
- @click.option("--model", default=None, help="Model: default, fast, or smart")
17
- def init(api_key, provider, model):
18
- """Initialize AgenticStack in this project."""
19
- if config_exists():
20
- click.echo("AgenticStack: Config already exists. Use 'agenticstack update' to refresh.")
21
- return
22
-
23
- create_default_config()
24
- click.echo("AgenticStack: Created .agenticstack.ini")
25
- create_default_ignore_file()
26
- click.echo("AgenticStack: Created .agenticstackignore")
27
-
28
- if api_key:
29
- write_config("api_key", api_key)
30
- if provider:
31
- write_config("provider", provider)
32
- if model:
33
- write_config("model", model)
34
-
35
- run(Path.cwd())
36
-
37
-
38
- @main.command()
39
- def update():
40
- """Refresh AgenticStack.txt for this project."""
41
- if not config_exists():
42
- click.echo("AgenticStack: No config found. Run 'agenticstack init' first.")
43
- return
44
-
45
- run(Path.cwd())
@@ -1,5 +0,0 @@
1
- from pathlib import Path
2
-
3
-
4
- def write_output(content: str, output_path: Path) -> None:
5
- output_path.write_text(content, encoding="utf-8")
@@ -1,72 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: agenticstackfile
3
- Version: 0.1.3
4
- Summary: Instant codebase map for AI agents — understand any project before making changes
5
- Author-email: Rajat Handa <handarajat111@gmail.com>
6
- License-Expression: MIT
7
- Requires-Python: >=3.9
8
- Description-Content-Type: text/markdown
9
- Requires-Dist: click>=8.0.0
10
- Provides-Extra: anthropic
11
- Requires-Dist: anthropic>=0.20.0; extra == "anthropic"
12
- Provides-Extra: openai
13
- Requires-Dist: openai>=1.0.0; extra == "openai"
14
- Provides-Extra: all
15
- Requires-Dist: anthropic>=0.20.0; extra == "all"
16
- Requires-Dist: openai>=1.0.0; extra == "all"
17
-
18
- # AgenticStack
19
-
20
- Instant codebase map for AI agents — understand any project before making changes.
21
-
22
- ## What it does
23
-
24
- AgenticStack analyzes your Python project and generates `AgenticStack.txt` — a structured file that tells any AI agent:
25
-
26
- - Where every model, view, serializer, and service lives
27
- - Which files to touch when making a specific change
28
- - Which models are exposed via API vs internal only
29
- - Step by step how-to guides using your actual file paths
30
-
31
- ## Installation
32
-
33
- ```bash
34
- pip install agenticstackfile
35
- ```
36
-
37
- With AI support:
38
-
39
- ```bash
40
- pip install 'agenticstackfile[openai]'
41
- pip install 'agenticstackfile[anthropic]'
42
- ```
43
-
44
- ## Usage
45
-
46
- ```bash
47
- agenticstack init # First time setup
48
- agenticstack update # Refresh AgenticStack.txt
49
- ```
50
-
51
- ## Modes
52
-
53
- **Static mode** — no API key needed. Uses Python AST to analyze your codebase for free.
54
-
55
- **AI mode** — provide an API key and Claude or GPT generates rich, detailed documentation.
56
-
57
- ## Configuration
58
-
59
- Edit `.agenticstack.ini` in your project root:
60
-
61
- ```ini
62
- [agenticstack]
63
- model = default
64
- api_key = YOUR_API_KEY
65
- provider = anthropic
66
- output_file = AgenticStack.txt
67
- ```
68
-
69
- ## Supported providers
70
-
71
- - `anthropic` — Claude Sonnet, Haiku, Opus
72
- - `openai` — GPT-4o, GPT-4o-mini