@flydocs/cli 0.6.0-alpha.13 → 0.6.0-alpha.20

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 (152) hide show
  1. package/dist/cli.js +281 -256
  2. package/package.json +1 -1
  3. package/template/.claude/CLAUDE.md +62 -66
  4. package/template/.claude/agents/implementation-agent.md +1 -1
  5. package/template/.claude/agents/pm-agent.md +1 -1
  6. package/template/.claude/commands/activate.md +1 -1
  7. package/template/.claude/commands/attach.md +1 -1
  8. package/template/.claude/commands/block.md +2 -2
  9. package/template/.claude/commands/capture.md +1 -1
  10. package/template/.claude/commands/close.md +1 -1
  11. package/template/.claude/commands/flydocs-setup.md +261 -58
  12. package/template/.claude/commands/flydocs-upgrade.md +26 -27
  13. package/template/.claude/commands/implement.md +1 -1
  14. package/template/.claude/commands/new-project.md +1 -1
  15. package/template/.claude/commands/onboard.md +275 -0
  16. package/template/.claude/commands/project-update.md +1 -1
  17. package/template/.claude/commands/refine.md +1 -1
  18. package/template/.claude/commands/review.md +1 -1
  19. package/template/.claude/commands/start-session.md +1 -1
  20. package/template/.claude/commands/status.md +1 -1
  21. package/template/.claude/commands/validate.md +1 -1
  22. package/template/.claude/commands/wrap-session.md +1 -1
  23. package/template/.claude/hooks/auto-approve.py +132 -0
  24. package/template/.claude/hooks/post-pr-check.py +108 -0
  25. package/template/.claude/hooks/post-transition-check.py +94 -0
  26. package/template/{.flydocs → .claude}/hooks/prompt-submit.py +167 -17
  27. package/template/.claude/hooks/session-start.py +146 -0
  28. package/template/.claude/hooks/stop-gate.py +109 -0
  29. package/template/.claude/settings.json +41 -4
  30. package/template/.claude/skills/README.md +23 -25
  31. package/template/.claude/skills/flydocs-workflow/SKILL.md +121 -34
  32. package/template/.claude/skills/flydocs-workflow/cursor-rule.mdc +9 -8
  33. package/template/.claude/skills/flydocs-workflow/reference/golden-rules.md +28 -17
  34. package/template/.claude/skills/flydocs-workflow/reference/graph-schema.md +116 -0
  35. package/template/.claude/skills/flydocs-workflow/reference/pr-workflow.md +30 -15
  36. package/template/.claude/skills/flydocs-workflow/reference/priority-estimates.md +1 -1
  37. package/template/.claude/skills/flydocs-workflow/reference/service-descriptor-schema.md +251 -0
  38. package/template/.claude/skills/flydocs-workflow/reference/status-workflow.md +26 -26
  39. package/template/.claude/skills/flydocs-workflow/scripts/_local/__init__.py +0 -0
  40. package/template/.claude/skills/{flydocs-local/scripts/flydocs_api.py → flydocs-workflow/scripts/_local/file_store.py} +133 -46
  41. package/template/.claude/skills/flydocs-workflow/scripts/flydocs_api.py +693 -0
  42. package/template/{.flydocs → .claude/skills/flydocs-workflow}/scripts/generate_manifest.py +4 -4
  43. package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_build.py +132 -1
  44. package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_query.py +18 -5
  45. package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_session.py +1 -1
  46. package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_update.py +4 -4
  47. package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_utils.py +2 -1
  48. package/template/.claude/skills/flydocs-workflow/scripts/issues.py +489 -0
  49. package/template/.claude/skills/flydocs-workflow/scripts/projects.py +144 -0
  50. package/template/.claude/skills/flydocs-workflow/scripts/pull_services.py +128 -0
  51. package/template/.claude/skills/flydocs-workflow/scripts/push_service.py +132 -0
  52. package/template/.claude/skills/flydocs-workflow/scripts/session.py +54 -0
  53. package/template/.claude/skills/flydocs-workflow/scripts/workspace.py +860 -0
  54. package/template/.claude/skills/flydocs-workflow/session.md +16 -11
  55. package/template/.claude/skills/flydocs-workflow/stages/activate.md +13 -8
  56. package/template/.claude/skills/flydocs-workflow/stages/capture.md +4 -4
  57. package/template/.claude/skills/flydocs-workflow/stages/close.md +1 -1
  58. package/template/.claude/skills/flydocs-workflow/stages/implement.md +7 -7
  59. package/template/.claude/skills/flydocs-workflow/stages/refine.md +5 -5
  60. package/template/.claude/skills/flydocs-workflow/stages/review.md +2 -2
  61. package/template/.claude/skills/flydocs-workflow/stages/validate.md +3 -1
  62. package/template/.claude/skills/flydocs-workflow/templates/pr/default.md +33 -0
  63. package/template/.cursor/agents/implementation-agent.md +1 -1
  64. package/template/.cursor/agents/pm-agent.md +2 -2
  65. package/template/.cursor/hooks.json +10 -3
  66. package/template/.env.example +6 -6
  67. package/template/.flydocs/config.json +2 -1
  68. package/template/.flydocs/templates/README.md +13 -14
  69. package/template/.flydocs/templates/quick-capture.md +4 -8
  70. package/template/.flydocs/version +1 -1
  71. package/template/AGENTS.md +39 -32
  72. package/template/flydocs/README.md +1 -3
  73. package/template/flydocs/context/project.md +6 -3
  74. package/template/flydocs/design-system/README.md +3 -3
  75. package/template/manifest.json +17 -19
  76. package/template/.claude/skills/flydocs-cloud/SKILL.md +0 -138
  77. package/template/.claude/skills/flydocs-cloud/cursor-rule.mdc +0 -50
  78. package/template/.claude/skills/flydocs-cloud/scripts/assign.py +0 -28
  79. package/template/.claude/skills/flydocs-cloud/scripts/assign_cycle.py +0 -28
  80. package/template/.claude/skills/flydocs-cloud/scripts/assign_milestone.py +0 -22
  81. package/template/.claude/skills/flydocs-cloud/scripts/comment.py +0 -29
  82. package/template/.claude/skills/flydocs-cloud/scripts/create_issue.py +0 -83
  83. package/template/.claude/skills/flydocs-cloud/scripts/create_milestone.py +0 -35
  84. package/template/.claude/skills/flydocs-cloud/scripts/create_project.py +0 -33
  85. package/template/.claude/skills/flydocs-cloud/scripts/create_team.py +0 -39
  86. package/template/.claude/skills/flydocs-cloud/scripts/delete_milestone.py +0 -21
  87. package/template/.claude/skills/flydocs-cloud/scripts/estimate.py +0 -33
  88. package/template/.claude/skills/flydocs-cloud/scripts/flydocs_api.py +0 -241
  89. package/template/.claude/skills/flydocs-cloud/scripts/generate_config.py +0 -125
  90. package/template/.claude/skills/flydocs-cloud/scripts/get_estimate_scale.py +0 -23
  91. package/template/.claude/skills/flydocs-cloud/scripts/get_issue.py +0 -24
  92. package/template/.claude/skills/flydocs-cloud/scripts/get_me.py +0 -103
  93. package/template/.claude/skills/flydocs-cloud/scripts/link.py +0 -28
  94. package/template/.claude/skills/flydocs-cloud/scripts/list_cycles.py +0 -28
  95. package/template/.claude/skills/flydocs-cloud/scripts/list_issues.py +0 -44
  96. package/template/.claude/skills/flydocs-cloud/scripts/list_labels.py +0 -19
  97. package/template/.claude/skills/flydocs-cloud/scripts/list_milestones.py +0 -28
  98. package/template/.claude/skills/flydocs-cloud/scripts/list_projects.py +0 -31
  99. package/template/.claude/skills/flydocs-cloud/scripts/list_providers.py +0 -19
  100. package/template/.claude/skills/flydocs-cloud/scripts/list_statuses.py +0 -19
  101. package/template/.claude/skills/flydocs-cloud/scripts/list_teams.py +0 -19
  102. package/template/.claude/skills/flydocs-cloud/scripts/priority.py +0 -29
  103. package/template/.claude/skills/flydocs-cloud/scripts/project_update.py +0 -45
  104. package/template/.claude/skills/flydocs-cloud/scripts/refresh_labels.py +0 -87
  105. package/template/.claude/skills/flydocs-cloud/scripts/set_identity.py +0 -54
  106. package/template/.claude/skills/flydocs-cloud/scripts/set_labels.py +0 -54
  107. package/template/.claude/skills/flydocs-cloud/scripts/set_preferences.py +0 -49
  108. package/template/.claude/skills/flydocs-cloud/scripts/set_provider.py +0 -31
  109. package/template/.claude/skills/flydocs-cloud/scripts/set_status_mapping.py +0 -57
  110. package/template/.claude/skills/flydocs-cloud/scripts/set_team.py +0 -28
  111. package/template/.claude/skills/flydocs-cloud/scripts/transition.py +0 -26
  112. package/template/.claude/skills/flydocs-cloud/scripts/update_description.py +0 -36
  113. package/template/.claude/skills/flydocs-cloud/scripts/update_issue.py +0 -100
  114. package/template/.claude/skills/flydocs-cloud/scripts/update_milestone.py +0 -42
  115. package/template/.claude/skills/flydocs-cloud/scripts/validate_setup.py +0 -120
  116. package/template/.claude/skills/flydocs-context-graph/SKILL.md +0 -94
  117. package/template/.claude/skills/flydocs-context-graph/schema.md +0 -78
  118. package/template/.claude/skills/flydocs-context-graph/scripts/graph_context.py +0 -338
  119. package/template/.claude/skills/flydocs-context7/SKILL.md +0 -105
  120. package/template/.claude/skills/flydocs-context7/cursor-rule.mdc +0 -49
  121. package/template/.claude/skills/flydocs-context7/scripts/context7.py +0 -293
  122. package/template/.claude/skills/flydocs-estimates/SKILL.md +0 -384
  123. package/template/.claude/skills/flydocs-figma/SKILL.md +0 -377
  124. package/template/.claude/skills/flydocs-figma/references/PROMPTING.md +0 -108
  125. package/template/.claude/skills/flydocs-figma/references/TROUBLESHOOTING.md +0 -112
  126. package/template/.claude/skills/flydocs-local/SKILL.md +0 -103
  127. package/template/.claude/skills/flydocs-local/cursor-rule.mdc +0 -43
  128. package/template/.claude/skills/flydocs-local/scripts/assign.py +0 -29
  129. package/template/.claude/skills/flydocs-local/scripts/comment.py +0 -27
  130. package/template/.claude/skills/flydocs-local/scripts/create_issue.py +0 -44
  131. package/template/.claude/skills/flydocs-local/scripts/estimate.py +0 -37
  132. package/template/.claude/skills/flydocs-local/scripts/get_issue.py +0 -20
  133. package/template/.claude/skills/flydocs-local/scripts/link.py +0 -41
  134. package/template/.claude/skills/flydocs-local/scripts/list_issues.py +0 -50
  135. package/template/.claude/skills/flydocs-local/scripts/priority.py +0 -37
  136. package/template/.claude/skills/flydocs-local/scripts/project_update.py +0 -67
  137. package/template/.claude/skills/flydocs-local/scripts/status_summary.py +0 -16
  138. package/template/.claude/skills/flydocs-local/scripts/transition.py +0 -24
  139. package/template/.claude/skills/flydocs-local/scripts/update_description.py +0 -35
  140. package/template/.claude/skills/flydocs-local/scripts/update_issue.py +0 -84
  141. package/template/.flydocs/hooks/auto-approve.py +0 -71
  142. package/template/.flydocs/scripts/skill_manager.py +0 -541
  143. package/template/.flydocs/templates/bug.md +0 -166
  144. package/template/.flydocs/templates/chore.md +0 -110
  145. package/template/.flydocs/templates/feature.md +0 -173
  146. package/template/.flydocs/templates/idea.md +0 -122
  147. /package/template/{.flydocs → .claude}/hooks/post-edit.py +0 -0
  148. /package/template/.claude/skills/{flydocs-estimates/references → flydocs-workflow/reference}/provider-costs.md +0 -0
  149. /package/template/.claude/skills/flydocs-workflow/templates/{bug.md → issues/bug.md} +0 -0
  150. /package/template/.claude/skills/flydocs-workflow/templates/{chore.md → issues/chore.md} +0 -0
  151. /package/template/.claude/skills/flydocs-workflow/templates/{feature.md → issues/feature.md} +0 -0
  152. /package/template/.claude/skills/flydocs-workflow/templates/{idea.md → issues/idea.md} +0 -0
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env python3
2
- """List available team labels via the FlyDocs Relay API."""
3
-
4
- import sys
5
- from pathlib import Path
6
-
7
- sys.path.insert(0, str(Path(__file__).parent))
8
- from flydocs_api import get_client, output_json
9
-
10
-
11
- def main():
12
- client = get_client()
13
- result = client.get("/labels")
14
-
15
- output_json(result)
16
-
17
-
18
- if __name__ == "__main__":
19
- main()
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env python3
2
- """List milestones via the FlyDocs Relay API."""
3
-
4
- import argparse
5
- import sys
6
- from pathlib import Path
7
-
8
- sys.path.insert(0, str(Path(__file__).parent))
9
- from flydocs_api import get_client, output_json
10
-
11
-
12
- def main():
13
- parser = argparse.ArgumentParser(description="List milestones")
14
- parser.add_argument("--all", action="store_true", dest="show_all")
15
- args = parser.parse_args()
16
-
17
- params: dict = {}
18
- if args.show_all:
19
- params["all"] = "true"
20
-
21
- client = get_client()
22
- result = client.get("/milestones", params=params)
23
-
24
- output_json(result)
25
-
26
-
27
- if __name__ == "__main__":
28
- main()
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env python3
2
- """List projects via the FlyDocs Relay API."""
3
-
4
- import argparse
5
- import sys
6
- from pathlib import Path
7
-
8
- sys.path.insert(0, str(Path(__file__).parent))
9
- from flydocs_api import get_client, output_json
10
-
11
-
12
- def main():
13
- parser = argparse.ArgumentParser(description="List projects")
14
- parser.add_argument("--active", action="store_true")
15
- parser.add_argument("--all", action="store_true", dest="show_all")
16
- args = parser.parse_args()
17
-
18
- params: dict = {}
19
- if args.active:
20
- params["active"] = "true"
21
- if args.show_all:
22
- params["all"] = "true"
23
-
24
- client = get_client()
25
- result = client.get("/projects", params=params)
26
-
27
- output_json(result)
28
-
29
-
30
- if __name__ == "__main__":
31
- main()
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env python3
2
- """List available providers via the FlyDocs Relay API."""
3
-
4
- import sys
5
- from pathlib import Path
6
-
7
- sys.path.insert(0, str(Path(__file__).parent))
8
- from flydocs_api import get_client, output_json
9
-
10
-
11
- def main():
12
- client = get_client()
13
- result = client.get("/providers")
14
-
15
- output_json(result)
16
-
17
-
18
- if __name__ == "__main__":
19
- main()
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env python3
2
- """List provider workflow states via the FlyDocs Relay API."""
3
-
4
- import sys
5
- from pathlib import Path
6
-
7
- sys.path.insert(0, str(Path(__file__).parent))
8
- from flydocs_api import get_client, output_json
9
-
10
-
11
- def main():
12
- client = get_client()
13
- result = client.get("/auth/statuses")
14
-
15
- output_json(result)
16
-
17
-
18
- if __name__ == "__main__":
19
- main()
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env python3
2
- """List available teams/projects via the FlyDocs Relay API."""
3
-
4
- import sys
5
- from pathlib import Path
6
-
7
- sys.path.insert(0, str(Path(__file__).parent))
8
- from flydocs_api import get_client, output_json
9
-
10
-
11
- def main():
12
- client = get_client()
13
- result = client.get("/teams")
14
-
15
- output_json(result)
16
-
17
-
18
- if __name__ == "__main__":
19
- main()
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Set priority on an issue via the FlyDocs Relay API."""
3
-
4
- import sys
5
- from pathlib import Path
6
-
7
- sys.path.insert(0, str(Path(__file__).parent))
8
- from flydocs_api import get_client, output_json, fail
9
-
10
- if len(sys.argv) < 3:
11
- fail("Usage: priority.py <ref> <0-4>")
12
-
13
- ref = sys.argv[1]
14
- try:
15
- priority = int(sys.argv[2])
16
- except ValueError:
17
- fail("Priority must be a number (0-4)")
18
-
19
- if priority not in range(5):
20
- fail("Priority must be 0 (none), 1 (urgent), 2 (high), 3 (medium), or 4 (low)")
21
-
22
- client = get_client()
23
- result = client.put(f"/issues/{ref}/priority", {"priority": priority})
24
-
25
- output_json({
26
- "success": result.get("success", True),
27
- "issue": result.get("issue", ref),
28
- "priority": result.get("priority", priority),
29
- })
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Post a project update via the FlyDocs Relay API."""
3
-
4
- import argparse
5
- import sys
6
- from pathlib import Path
7
-
8
- sys.path.insert(0, str(Path(__file__).parent))
9
- from flydocs_api import get_client, output_json, fail
10
-
11
-
12
- def main():
13
- parser = argparse.ArgumentParser(description="Post project update")
14
- parser.add_argument("--health", required=True, choices=["onTrack", "atRisk", "offTrack"])
15
- parser.add_argument("--body", default=None)
16
- parser.add_argument("--body-file", default=None, dest="body_file")
17
- args = parser.parse_args()
18
-
19
- # Resolve body: --body-file > stdin > --body
20
- body = args.body
21
- if args.body_file:
22
- try:
23
- body = Path(args.body_file).read_text()
24
- except FileNotFoundError:
25
- fail(f"File not found: {args.body_file}")
26
- elif body is None and not sys.stdin.isatty():
27
- body = sys.stdin.read().strip()
28
-
29
- if not body:
30
- fail("Provide body via --body, --body-file, or stdin")
31
-
32
- client = get_client()
33
- result = client.post("/projects/update", {
34
- "health": args.health,
35
- "body": body,
36
- })
37
-
38
- output_json({
39
- "success": result.get("success", True),
40
- "id": result.get("id", ""),
41
- })
42
-
43
-
44
- if __name__ == "__main__":
45
- main()
@@ -1,87 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Refresh label config from the relay — validates and updates local config.
3
-
4
- Fetches current team labels from the relay, compares against local config,
5
- and reports any stale or missing label IDs. With --fix, updates local config
6
- to match the relay's current state.
7
- """
8
-
9
- import json
10
- import sys
11
- from pathlib import Path
12
-
13
- sys.path.insert(0, str(Path(__file__).parent))
14
- from flydocs_api import get_client, output_json, fail
15
-
16
-
17
- def main():
18
- fix_mode = "--fix" in sys.argv
19
-
20
- client = get_client()
21
-
22
- # Fetch current labels from relay
23
- labels = client.get("/labels")
24
- label_map = {l["id"]: l["name"] for l in labels}
25
- label_by_name = {l["name"].lower(): l["id"] for l in labels}
26
-
27
- # Load local config
28
- config_path = client.config_path
29
- if not config_path.exists():
30
- fail("No .flydocs/config.json found")
31
-
32
- with open(config_path, "r") as f:
33
- config = json.load(f)
34
-
35
- issue_labels = config.get("issueLabels", {})
36
- stale: list[dict] = []
37
- valid: list[dict] = []
38
-
39
- # Check each label ID in config against relay
40
- for category, entries in issue_labels.items():
41
- if isinstance(entries, dict):
42
- for key, label_id in entries.items():
43
- if label_id in label_map:
44
- valid.append({"category": category, "key": key, "id": label_id, "name": label_map[label_id]})
45
- else:
46
- # Try to find by key name
47
- resolved = label_by_name.get(key.lower())
48
- stale.append({
49
- "category": category,
50
- "key": key,
51
- "staleId": label_id,
52
- "resolvedId": resolved,
53
- "resolvedName": key if resolved else None,
54
- })
55
-
56
- if fix_mode and stale:
57
- # Update stale IDs in config
58
- fixed = 0
59
- for item in stale:
60
- if item["resolvedId"]:
61
- issue_labels[item["category"]][item["key"]] = item["resolvedId"]
62
- fixed += 1
63
-
64
- with open(config_path, "w") as f:
65
- json.dump(config, f, indent=2)
66
- f.write("\n")
67
-
68
- output_json({
69
- "success": True,
70
- "valid": len(valid),
71
- "stale": len(stale),
72
- "fixed": fixed,
73
- "unfixable": len(stale) - fixed,
74
- "details": stale,
75
- })
76
- else:
77
- output_json({
78
- "valid": len(valid),
79
- "stale": len(stale),
80
- "totalProviderLabels": len(labels),
81
- "details": stale if stale else "All label IDs are current",
82
- "hint": "Run with --fix to update stale IDs" if stale else None,
83
- })
84
-
85
-
86
- if __name__ == "__main__":
87
- main()
@@ -1,54 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Set provider identity via the FlyDocs Relay API.
3
-
4
- Binds the user's provider-specific ID to their FlyDocs user record.
5
- Once set, ?mine=true resolves via exact provider ID matching.
6
-
7
- Also writes .flydocs/me.json for local identity resolution (e.g. --mine
8
- in list_issues.py). This file is gitignored — each developer has their own.
9
- """
10
-
11
- import json
12
- import sys
13
- from pathlib import Path
14
-
15
- sys.path.insert(0, str(Path(__file__).parent))
16
- from flydocs_api import get_client, output_json, fail
17
-
18
- VALID_PROVIDERS = ("linear", "jira", "gitlab")
19
-
20
- if len(sys.argv) < 3:
21
- fail(f"Usage: set_identity.py <provider> <provider-user-id>\n Providers: {', '.join(VALID_PROVIDERS)}")
22
-
23
- provider = sys.argv[1].lower()
24
- provider_id = sys.argv[2]
25
-
26
- if provider not in VALID_PROVIDERS:
27
- fail(f"Invalid provider: {provider}. Must be one of: {', '.join(VALID_PROVIDERS)}")
28
-
29
- if not provider_id:
30
- fail("Provider user ID cannot be empty")
31
-
32
- client = get_client()
33
- result = client.post("/auth/identity", {
34
- "provider": provider,
35
- "providerId": provider_id,
36
- })
37
-
38
- # Write me.json for local identity resolution
39
- me_data = {
40
- "provider": result.get("provider", provider),
41
- "providerId": result.get("providerId", provider_id),
42
- "displayName": result.get("displayName"),
43
- "email": result.get("email"),
44
- }
45
- me_path = Path(".flydocs/me.json")
46
- me_path.parent.mkdir(parents=True, exist_ok=True)
47
- me_path.write_text(json.dumps(me_data, indent=2) + "\n")
48
-
49
- output_json({
50
- "success": result.get("success", True),
51
- "provider": me_data["provider"],
52
- "providerId": me_data["providerId"],
53
- "meJson": str(me_path),
54
- })
@@ -1,54 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Set label config on the relay API key.
3
-
4
- Configures default labels and type-to-label mapping for automatic label
5
- application during issue creation.
6
-
7
- Usage:
8
- set_labels.py --defaults '["app"]' --type-map '{"feature":["Feature"],...}'
9
- echo '{"defaults":["app"],"typeMap":{...}}' | set_labels.py
10
- """
11
-
12
- import argparse
13
- import json
14
- import sys
15
- from pathlib import Path
16
-
17
- sys.path.insert(0, str(Path(__file__).parent))
18
- from flydocs_api import get_client, output_json, fail
19
-
20
-
21
- def main():
22
- parser = argparse.ArgumentParser(description="Set label config on relay")
23
- parser.add_argument("--defaults", default=None, help="JSON array of default label names")
24
- parser.add_argument("--type-map", default=None, dest="type_map", help="JSON object mapping issue types to label arrays")
25
- args = parser.parse_args()
26
-
27
- # Build body from flags or stdin
28
- if args.defaults is not None or args.type_map is not None:
29
- body: dict = {}
30
- if args.defaults is not None:
31
- try:
32
- body["defaults"] = json.loads(args.defaults)
33
- except json.JSONDecodeError:
34
- fail("Invalid JSON for --defaults")
35
- if args.type_map is not None:
36
- try:
37
- body["typeMap"] = json.loads(args.type_map)
38
- except json.JSONDecodeError:
39
- fail("Invalid JSON for --type-map")
40
- elif not sys.stdin.isatty():
41
- try:
42
- body = json.loads(sys.stdin.read().strip())
43
- except json.JSONDecodeError:
44
- fail("Invalid JSON on stdin")
45
- else:
46
- fail("Provide --defaults/--type-map flags or pipe JSON via stdin")
47
-
48
- client = get_client()
49
- result = client.post("/auth/labels", body)
50
- output_json(result)
51
-
52
-
53
- if __name__ == "__main__":
54
- main()
@@ -1,49 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Get or set user preferences via the FlyDocs Relay API.
3
-
4
- With no arguments, returns current preferences (GET).
5
- With flags, updates preferences (POST).
6
- """
7
-
8
- import argparse
9
- import sys
10
- from pathlib import Path
11
-
12
- sys.path.insert(0, str(Path(__file__).parent))
13
- from flydocs_api import get_client, output_json, fail
14
-
15
-
16
- def main():
17
- parser = argparse.ArgumentParser(description="Get or set user preferences")
18
- parser.add_argument("--workspace", default=None, help="Default workspace ID")
19
- parser.add_argument("--assignee", default=None, help="Default assignee ('self' or user ID)")
20
- parser.add_argument("--display", default=None, help="Display preferences (JSON string)")
21
- args = parser.parse_args()
22
-
23
- client = get_client()
24
-
25
- # If no flags provided, GET current preferences
26
- if args.workspace is None and args.assignee is None and args.display is None:
27
- result = client.get("/auth/preferences")
28
- output_json(result)
29
- return
30
-
31
- # Build update body from provided flags
32
- body: dict = {}
33
- if args.workspace is not None:
34
- body["defaultWorkspaceId"] = args.workspace
35
- if args.assignee is not None:
36
- body["defaultAssignee"] = args.assignee
37
- if args.display is not None:
38
- body["displayPreferences"] = args.display
39
-
40
- result = client.post("/auth/preferences", body)
41
-
42
- output_json({
43
- "success": result.get("success", True),
44
- "preferences": result.get("preferences", body),
45
- })
46
-
47
-
48
- if __name__ == "__main__":
49
- main()
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Set provider preference via the FlyDocs Relay API.
3
-
4
- Stores the provider type on the relay for server-side routing.
5
- Local config is updated by generate_config.py after all setup steps complete.
6
- """
7
-
8
- import argparse
9
- import sys
10
- from pathlib import Path
11
-
12
- sys.path.insert(0, str(Path(__file__).parent))
13
- from flydocs_api import get_client, output_json, fail
14
-
15
-
16
- def main():
17
- parser = argparse.ArgumentParser(description="Set provider preference")
18
- parser.add_argument(
19
- "provider_type",
20
- choices=["linear", "jira"],
21
- help="Provider type",
22
- )
23
- args = parser.parse_args()
24
-
25
- client = get_client()
26
- result = client.post("/auth/provider", {"providerType": args.provider_type})
27
- output_json(result)
28
-
29
-
30
- if __name__ == "__main__":
31
- main()
@@ -1,57 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Set status mapping on the relay API key.
3
-
4
- Maps provider workflow states to FlyDocs statuses. Pass "auto" for
5
- case-insensitive auto-mapping, or provide a manual mapping object.
6
-
7
- Usage:
8
- set_status_mapping.py --auto
9
- set_status_mapping.py --mapping '{"BACKLOG":"Backlog","IMPLEMENTING":"In Progress",...}'
10
- echo '{"mapping":"auto"}' | set_status_mapping.py
11
- """
12
-
13
- import argparse
14
- import json
15
- import sys
16
- from pathlib import Path
17
-
18
- sys.path.insert(0, str(Path(__file__).parent))
19
- from flydocs_api import get_client, output_json, fail
20
-
21
-
22
- def main():
23
- parser = argparse.ArgumentParser(description="Set status mapping on relay")
24
- parser.add_argument(
25
- "--auto",
26
- action="store_true",
27
- help="Auto-map provider states to FlyDocs statuses by name",
28
- )
29
- parser.add_argument(
30
- "--mapping",
31
- default=None,
32
- help="JSON object mapping FlyDocs statuses to provider state names",
33
- )
34
- args = parser.parse_args()
35
-
36
- if args.auto:
37
- body: dict = {"mapping": "auto"}
38
- elif args.mapping is not None:
39
- try:
40
- body = {"mapping": json.loads(args.mapping)}
41
- except json.JSONDecodeError:
42
- fail("Invalid JSON for --mapping")
43
- elif not sys.stdin.isatty():
44
- try:
45
- body = json.loads(sys.stdin.read().strip())
46
- except json.JSONDecodeError:
47
- fail("Invalid JSON on stdin")
48
- else:
49
- fail("Provide --auto, --mapping '{...}', or pipe JSON via stdin")
50
-
51
- client = get_client()
52
- result = client.post("/auth/statuses", body)
53
- output_json(result)
54
-
55
-
56
- if __name__ == "__main__":
57
- main()
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Set team/project preference via the FlyDocs Relay API.
3
-
4
- Stores the team preference on the relay for server-side scoping.
5
- Local config is updated by generate_config.py after all setup steps complete.
6
- For Jira, this sets the active Jira project.
7
- """
8
-
9
- import argparse
10
- import sys
11
- from pathlib import Path
12
-
13
- sys.path.insert(0, str(Path(__file__).parent))
14
- from flydocs_api import get_client, output_json, fail
15
-
16
-
17
- def main():
18
- parser = argparse.ArgumentParser(description="Set team or project preference")
19
- parser.add_argument("team_id", help="Provider team/workspace UUID")
20
- args = parser.parse_args()
21
-
22
- client = get_client()
23
- result = client.post("/auth/team", {"teamId": args.team_id})
24
- output_json(result)
25
-
26
-
27
- if __name__ == "__main__":
28
- main()
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Transition an issue to a new status with a required comment."""
3
-
4
- import sys
5
- from pathlib import Path
6
-
7
- sys.path.insert(0, str(Path(__file__).parent))
8
- from flydocs_api import get_client, output_json, fail
9
-
10
- if len(sys.argv) < 4:
11
- fail("Usage: transition.py <ref> <STATUS> <comment>")
12
-
13
- ref, status, comment = sys.argv[1], sys.argv[2].upper(), sys.argv[3]
14
- client = get_client()
15
-
16
- result = client.post(f"/issues/{ref}/transition", {
17
- "status": status,
18
- "comment": comment,
19
- })
20
-
21
- output_json({
22
- "success": result.get("success", True),
23
- "issue": result.get("issue", ref),
24
- "previousStatus": result.get("previousStatus", ""),
25
- "newStatus": result.get("newStatus", status),
26
- })
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Update an issue's description via the FlyDocs Relay API."""
3
-
4
- import argparse
5
- import sys
6
- from pathlib import Path
7
-
8
- sys.path.insert(0, str(Path(__file__).parent))
9
- from flydocs_api import get_client, output_json, fail
10
-
11
- parser = argparse.ArgumentParser(description="Update issue description")
12
- parser.add_argument("ref", help="Issue reference (e.g., ENG-123)")
13
- parser.add_argument("--text", default=None)
14
- parser.add_argument("--file", default=None)
15
- args = parser.parse_args()
16
-
17
- # Resolve text: --file > stdin > --text
18
- text = args.text
19
- if args.file:
20
- try:
21
- text = Path(args.file).read_text()
22
- except FileNotFoundError:
23
- fail(f"File not found: {args.file}")
24
- elif text is None and not sys.stdin.isatty():
25
- text = sys.stdin.read().strip()
26
-
27
- if not text:
28
- fail("Provide text via --text, --file, or stdin")
29
-
30
- client = get_client()
31
- result = client.put(f"/issues/{args.ref}/description", {"text": text})
32
-
33
- output_json({
34
- "success": result.get("success", True),
35
- "issue": result.get("issue", args.ref),
36
- })