@timetotest/cli 0.1.11 → 0.2.1

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 (185) hide show
  1. package/README.md +201 -190
  2. package/dist/bin/ttt.js +4 -2
  3. package/dist/bin/ttt.js.map +1 -1
  4. package/dist/package.json +13 -2
  5. package/dist/src/commands/ask/AskApp.js +121 -0
  6. package/dist/src/commands/ask/AskApp.js.map +1 -0
  7. package/dist/src/commands/ask/components/AssistantResponse.js +31 -0
  8. package/dist/src/commands/ask/components/AssistantResponse.js.map +1 -0
  9. package/dist/src/commands/ask/components/Banner.js +15 -0
  10. package/dist/src/commands/ask/components/Banner.js.map +1 -0
  11. package/dist/src/commands/ask/components/ChatInput.js +93 -0
  12. package/dist/src/commands/ask/components/ChatInput.js.map +1 -0
  13. package/dist/src/commands/ask/components/Divider.js +17 -0
  14. package/dist/src/commands/ask/components/Divider.js.map +1 -0
  15. package/dist/src/commands/ask/components/IntroTips.js +19 -0
  16. package/dist/src/commands/ask/components/IntroTips.js.map +1 -0
  17. package/dist/src/commands/ask/components/MessageBubble.js +47 -0
  18. package/dist/src/commands/ask/components/MessageBubble.js.map +1 -0
  19. package/dist/src/commands/ask/components/SessionInfo.js +20 -0
  20. package/dist/src/commands/ask/components/SessionInfo.js.map +1 -0
  21. package/dist/src/commands/ask/components/StatusIndicator.js +67 -0
  22. package/dist/src/commands/ask/components/StatusIndicator.js.map +1 -0
  23. package/dist/src/commands/ask-ink.js +380 -0
  24. package/dist/src/commands/ask-ink.js.map +1 -0
  25. package/dist/src/commands/ask.js +73 -60
  26. package/dist/src/commands/ask.js.map +1 -1
  27. package/dist/src/commands/chat/ChatApp.js +125 -0
  28. package/dist/src/commands/chat/ChatApp.js.map +1 -0
  29. package/dist/src/commands/chat-ink.js +436 -0
  30. package/dist/src/commands/chat-ink.js.map +1 -0
  31. package/dist/src/commands/chat.js +82 -0
  32. package/dist/src/commands/chat.js.map +1 -0
  33. package/dist/src/commands/login.js +6 -4
  34. package/dist/src/commands/login.js.map +1 -1
  35. package/dist/src/commands/start-test.js +62 -88
  36. package/dist/src/commands/start-test.js.map +1 -1
  37. package/dist/src/commands/stream.js +9 -9
  38. package/dist/src/commands/stream.js.map +1 -1
  39. package/dist/src/commands/test.js +58 -125
  40. package/dist/src/commands/test.js.map +1 -1
  41. package/dist/src/lib/agent-orchestrator.js +546 -0
  42. package/dist/src/lib/agent-orchestrator.js.map +1 -0
  43. package/dist/src/lib/cloudinary-service.js +65 -0
  44. package/dist/src/lib/cloudinary-service.js.map +1 -0
  45. package/dist/src/lib/events.js +73 -60
  46. package/dist/src/lib/events.js.map +1 -1
  47. package/dist/src/lib/http.js +34 -1
  48. package/dist/src/lib/http.js.map +1 -1
  49. package/dist/src/lib/legacy-chat-runner.js +37 -0
  50. package/dist/src/lib/legacy-chat-runner.js.map +1 -0
  51. package/dist/src/lib/local-tools/api/api-discovery.js +17 -0
  52. package/dist/src/lib/local-tools/api/api-discovery.js.map +1 -0
  53. package/dist/src/lib/local-tools/api/build-request.js +20 -0
  54. package/dist/src/lib/local-tools/api/build-request.js.map +1 -0
  55. package/dist/src/lib/local-tools/api/extract-response-fields.js +26 -0
  56. package/dist/src/lib/local-tools/api/extract-response-fields.js.map +1 -0
  57. package/dist/src/lib/local-tools/api/generate-api-test.js +20 -0
  58. package/dist/src/lib/local-tools/api/generate-api-test.js.map +1 -0
  59. package/dist/src/lib/local-tools/api/generate-curl.js +8 -0
  60. package/dist/src/lib/local-tools/api/generate-curl.js.map +1 -0
  61. package/dist/src/lib/local-tools/api/get-api-parameters.js +17 -0
  62. package/dist/src/lib/local-tools/api/get-api-parameters.js.map +1 -0
  63. package/dist/src/lib/local-tools/api/index.js +10 -0
  64. package/dist/src/lib/local-tools/api/index.js.map +1 -0
  65. package/dist/src/lib/local-tools/api/request.js +43 -0
  66. package/dist/src/lib/local-tools/api/request.js.map +1 -0
  67. package/dist/src/lib/local-tools/api/set-auth-header.js +8 -0
  68. package/dist/src/lib/local-tools/api/set-auth-header.js.map +1 -0
  69. package/dist/src/lib/local-tools/api/types.js +2 -0
  70. package/dist/src/lib/local-tools/api/types.js.map +1 -0
  71. package/dist/src/lib/local-tools/api/utils.js +33 -0
  72. package/dist/src/lib/local-tools/api/utils.js.map +1 -0
  73. package/dist/src/lib/local-tools/api/validate-response.js +41 -0
  74. package/dist/src/lib/local-tools/api/validate-response.js.map +1 -0
  75. package/dist/src/lib/local-tools/file-tools.js +45 -0
  76. package/dist/src/lib/local-tools/file-tools.js.map +1 -0
  77. package/dist/src/lib/local-tools/general/discover-local-services.js +95 -0
  78. package/dist/src/lib/local-tools/general/discover-local-services.js.map +1 -0
  79. package/dist/src/lib/local-tools/general/index.js +2 -0
  80. package/dist/src/lib/local-tools/general/index.js.map +1 -0
  81. package/dist/src/lib/local-tools/ui/click-element.js +105 -0
  82. package/dist/src/lib/local-tools/ui/click-element.js.map +1 -0
  83. package/dist/src/lib/local-tools/ui/dom-rag.js +201 -0
  84. package/dist/src/lib/local-tools/ui/dom-rag.js.map +1 -0
  85. package/dist/src/lib/local-tools/ui/find-element.js +31 -0
  86. package/dist/src/lib/local-tools/ui/find-element.js.map +1 -0
  87. package/dist/src/lib/local-tools/ui/hover-element.js +94 -0
  88. package/dist/src/lib/local-tools/ui/hover-element.js.map +1 -0
  89. package/dist/src/lib/local-tools/ui/index.js +3 -0
  90. package/dist/src/lib/local-tools/ui/index.js.map +1 -0
  91. package/dist/src/lib/local-tools/ui/manage-tab.js +65 -0
  92. package/dist/src/lib/local-tools/ui/manage-tab.js.map +1 -0
  93. package/dist/src/lib/local-tools/ui/navigate.js +35 -0
  94. package/dist/src/lib/local-tools/ui/navigate.js.map +1 -0
  95. package/dist/src/lib/local-tools/ui/page-discovery.js +32 -0
  96. package/dist/src/lib/local-tools/ui/page-discovery.js.map +1 -0
  97. package/dist/src/lib/local-tools/ui/playwright-mcp.js +217 -0
  98. package/dist/src/lib/local-tools/ui/playwright-mcp.js.map +1 -0
  99. package/dist/src/lib/local-tools/ui/screenshot.js +19 -0
  100. package/dist/src/lib/local-tools/ui/screenshot.js.map +1 -0
  101. package/dist/src/lib/local-tools/ui/search-interactive-elements.js +18 -0
  102. package/dist/src/lib/local-tools/ui/search-interactive-elements.js.map +1 -0
  103. package/dist/src/lib/local-tools/ui/selector-resolver.js +153 -0
  104. package/dist/src/lib/local-tools/ui/selector-resolver.js.map +1 -0
  105. package/dist/src/lib/local-tools/ui/snapshot-query.js +129 -0
  106. package/dist/src/lib/local-tools/ui/snapshot-query.js.map +1 -0
  107. package/dist/src/lib/local-tools/ui/type-text.js +40 -0
  108. package/dist/src/lib/local-tools/ui/type-text.js.map +1 -0
  109. package/dist/src/lib/local-tools/ui/types.js +2 -0
  110. package/dist/src/lib/local-tools/ui/types.js.map +1 -0
  111. package/dist/src/lib/local-tools/utility/finish-overall-test.js +12 -0
  112. package/dist/src/lib/local-tools/utility/finish-overall-test.js.map +1 -0
  113. package/dist/src/lib/local-tools/utility/index.js +2 -0
  114. package/dist/src/lib/local-tools/utility/index.js.map +1 -0
  115. package/dist/src/lib/prompts/builder.js +38 -0
  116. package/dist/src/lib/prompts/builder.js.map +1 -0
  117. package/dist/src/lib/prompts/index.js +7 -0
  118. package/dist/src/lib/prompts/index.js.map +1 -0
  119. package/dist/src/lib/prompts/templates.js +166 -0
  120. package/dist/src/lib/prompts/templates.js.map +1 -0
  121. package/dist/src/lib/session-manager.js +201 -0
  122. package/dist/src/lib/session-manager.js.map +1 -0
  123. package/dist/src/lib/socket.js +70 -9
  124. package/dist/src/lib/socket.js.map +1 -1
  125. package/dist/src/lib/testing-mode.js +33 -0
  126. package/dist/src/lib/testing-mode.js.map +1 -0
  127. package/dist/src/lib/tool-descriptions.js +59 -0
  128. package/dist/src/lib/tool-descriptions.js.map +1 -0
  129. package/dist/src/lib/tool-executor.js +537 -0
  130. package/dist/src/lib/tool-executor.js.map +1 -0
  131. package/dist/src/lib/tool-registry.js +803 -0
  132. package/dist/src/lib/tool-registry.js.map +1 -0
  133. package/dist/src/lib/tool-result-pruner.js +384 -0
  134. package/dist/src/lib/tool-result-pruner.js.map +1 -0
  135. package/dist/src/lib/tui/components/AskIntro.js +6 -0
  136. package/dist/src/lib/tui/components/AskIntro.js.map +1 -0
  137. package/dist/src/lib/tui/components/Banner.js +15 -0
  138. package/dist/src/lib/tui/components/Banner.js.map +1 -0
  139. package/dist/src/lib/tui/components/Divider.js +17 -0
  140. package/dist/src/lib/tui/components/Divider.js.map +1 -0
  141. package/dist/src/lib/tui/components/EventLine.js +110 -0
  142. package/dist/src/lib/tui/components/EventLine.js.map +1 -0
  143. package/dist/src/lib/tui/components/Header.js +15 -0
  144. package/dist/src/lib/tui/components/Header.js.map +1 -0
  145. package/dist/src/lib/tui/components/InputBox.js +9 -0
  146. package/dist/src/lib/tui/components/InputBox.js.map +1 -0
  147. package/dist/src/lib/tui/components/Mapping.js +8 -0
  148. package/dist/src/lib/tui/components/Mapping.js.map +1 -0
  149. package/dist/src/lib/tui/components/ProjectList.js +6 -0
  150. package/dist/src/lib/tui/components/ProjectList.js.map +1 -0
  151. package/dist/src/lib/tui/components/Spinner.js +20 -0
  152. package/dist/src/lib/tui/components/Spinner.js.map +1 -0
  153. package/dist/src/lib/tui/components/StatusBanner.js +12 -0
  154. package/dist/src/lib/tui/components/StatusBanner.js.map +1 -0
  155. package/dist/src/lib/tui/components/StatusBar.js +11 -0
  156. package/dist/src/lib/tui/components/StatusBar.js.map +1 -0
  157. package/dist/src/lib/tui/components/UserBubble.js +6 -0
  158. package/dist/src/lib/tui/components/UserBubble.js.map +1 -0
  159. package/dist/src/lib/tui/components/index.js +16 -0
  160. package/dist/src/lib/tui/components/index.js.map +1 -0
  161. package/dist/src/lib/tui/events.js +716 -76
  162. package/dist/src/lib/tui/events.js.map +1 -1
  163. package/dist/src/lib/tui/icons.js +14 -0
  164. package/dist/src/lib/tui/icons.js.map +1 -1
  165. package/dist/src/lib/tui/ink-print.js +41 -0
  166. package/dist/src/lib/tui/ink-print.js.map +1 -0
  167. package/dist/src/lib/tui/interactive-chat.js +345 -0
  168. package/dist/src/lib/tui/interactive-chat.js.map +1 -0
  169. package/dist/src/lib/tui/print.js +31 -26
  170. package/dist/src/lib/tui/print.js.map +1 -1
  171. package/dist/src/lib/tui/prompt.js +21 -18
  172. package/dist/src/lib/tui/prompt.js.map +1 -1
  173. package/dist/src/test-agent-flow.js +148 -0
  174. package/dist/src/test-agent-flow.js.map +1 -0
  175. package/dist/src/test-browser-session.js +152 -0
  176. package/dist/src/test-browser-session.js.map +1 -0
  177. package/dist/src/test-browser-snapshot.js +187 -0
  178. package/dist/src/test-browser-snapshot.js.map +1 -0
  179. package/dist/src/test-snapshot-detailed.js +219 -0
  180. package/dist/src/test-snapshot-detailed.js.map +1 -0
  181. package/dist/src/test-snapshot-simple.js +85 -0
  182. package/dist/src/test-snapshot-simple.js.map +1 -0
  183. package/dist/src/test-snapshot-tabs.js +110 -0
  184. package/dist/src/test-snapshot-tabs.js.map +1 -0
  185. package/package.json +13 -2
package/README.md CHANGED
@@ -1,293 +1,304 @@
1
- ### Time to Test CLI (`@timetotest/cli`)
1
+ # Time to Test CLI
2
2
 
3
- Visit: [timetotest.tech](https://timetotest.tech)
3
+ **Transform your testing workflow with an Agent that actually understands your application.**
4
4
 
5
- AI, agentic testing from a simple CLI.
6
- TimetoTest is an autonomous agent that plans, uses tools, and adapts to test your Web apps and APIs.
5
+ The Time to Test CLI is your intelligent testing companion that combines the power of AI reasoning with local execution capabilities. Instead of writing complex test scripts, simply chat with an AI agent that can see your application, interact with it, and generate comprehensive test reports.
7
6
 
8
- - Discovers pages/states (UI) or endpoints (API)
9
- - Captures screenshots and context
10
- - Generates high-quality test cases
11
- - Optionally executes and iterates
12
- - Produces shareable PDF reports
7
+ ## Why Time to Test CLI?
13
8
 
14
- Start fast with prompts, or run targeted tests against specific URLs and APIs.
9
+ ### **Test Without Writing Code**
15
10
 
16
- ## Install (Global)
11
+ - Describe what you want to test in plain English
12
+ - The AI agent understands your application and creates tests automatically
13
+ - No more spending hours writing boilerplate test code
17
14
 
18
- ```bash
19
- npm i -g @timetotest/cli
20
- ttt --version
21
- ```
15
+ ### **Local-First Testing**
22
16
 
23
- If you prefer not to install globally:
17
+ - Test your localhost applications directly (no tunneling required)
18
+ - AI agent runs browser automation and API calls on your machine
19
+ - Complete control over your testing environment
24
20
 
25
- ```bash
26
- npx @timetotest/cli --help
27
- ```
21
+ ### **Intelligent Test Discovery**
28
22
 
29
- ## Quick Start
23
+ - Automatically discovers pages, endpoints, and user flows
24
+ - Understands your application's structure and behavior
25
+ - Generates comprehensive test coverage without manual exploration
30
26
 
31
- 1. Log in
27
+ ### **Rich Reporting**
32
28
 
33
- ```bash
34
- ttt login
35
- ```
29
+ - Beautiful PDF reports with screenshots and test results
30
+ - Shareable links for team collaboration
31
+ - Detailed analysis of what was tested and what failed
36
32
 
37
- 2. Start a test
33
+ ## Quick Start
38
34
 
39
- - Easiest (no URL needed, uses your project’s saved URL):
35
+ ### 1. Install the CLI
40
36
 
41
37
  ```bash
42
- ttt start-test "Smoke test the main user journey" --execute --wait
38
+ npm install -g @timetotest/cli
43
39
  ```
44
40
 
45
- - With an explicit URL:
41
+ ### 2. Start Testing (Local Mode - Default)
46
42
 
47
43
  ```bash
48
- ttt test --url https://your-app.com --type ui --prompt "Smoke test the main user journey" --execute --wait
44
+ # Launch interactive chat with AI agent
45
+ ttt
46
+
47
+ # Or test a specific URL with a prompt
48
+ ttt test --url http://localhost:3000 --prompt "Test the user login flow"
49
49
  ```
50
50
 
51
- 3. Chat with the agent
51
+ ### 3. Cloud Mode (Optional)
52
52
 
53
53
  ```bash
54
- ttt ask
54
+ # Use remote AI agent (no localhost access)
55
+ ttt --cloud
55
56
  ```
56
57
 
57
- Tips:
58
+ ## How It Works
58
59
 
59
- - Use `--report [path]` to download a PDF when the test completes
60
- - Use `--share` to enable a public share link
61
- - Use `ttt stream <test-id>` to reattach to progress later
60
+ ### Local Mode (Default)
62
61
 
63
- - **Node requirement**: 18+
64
- - **Website**: [Time to Test](https://timetotest.tech)
62
+ When you run `ttt`, you get an AI agent that:
65
63
 
66
- ## Installation
64
+ - **Runs locally** on your machine using Playwright and HTTP clients
65
+ - **Sees your application** through browser automation
66
+ - **Understands your APIs** through intelligent discovery
67
+ - **Learns from interactions** to improve test coverage
68
+ - **Generates reports** with screenshots and detailed analysis
67
69
 
68
- Install globally (recommended):
70
+ ### Cloud Mode
69
71
 
70
- ```bash
71
- npm i -g @timetotest/cli
72
- ```
72
+ When you run `ttt --cloud`, you get:
73
73
 
74
- Or use without installing:
74
+ - **Remote AI agent** with no access to your localhost
75
+ - **Same conversation interface** but with cloud-based execution
76
+ - **Secure testing** for production environments
75
77
 
76
- ```bash
77
- npx @timetotest/cli --help
78
- ```
78
+ ## Key Features
79
79
 
80
- ## Quick Start
80
+ ### **UI Testing**
81
81
 
82
- 1. Authenticate
82
+ - **Smart Navigation**: AI understands your app's structure and navigates intelligently
83
+ - **Element Interaction**: Click, type, hover with natural language descriptions
84
+ - **Visual Validation**: Automatic screenshot capture and comparison
85
+ - **User Flow Testing**: Complete user journeys from login to checkout
83
86
 
84
- ```bash
85
- ttt login
86
- # Opens a browser to authenticate. As a fallback, you may be prompted to paste a short-lived token.
87
- ```
87
+ ### **API Testing**
88
88
 
89
- 2. Run a UI test against a local app
89
+ - **Automatic Discovery**: Finds and catalogs all your API endpoints
90
+ - **Request Building**: Generates proper requests with headers and payloads
91
+ - **Response Validation**: Checks status codes, schemas, and data integrity
92
+ - **Authentication Handling**: Manages tokens and session state
90
93
 
91
- ```bash
92
- ttt test \
93
- --url http://localhost:3000 \
94
- --type ui \
95
- --execute \
96
- --mode priority \
97
- --project-id 123 \
98
- --team-id 456 \
99
- --report ./report.pdf \
100
- --wait
101
- ```
94
+ ### **Advanced Capabilities**
102
95
 
103
- The CLI will automatically start an ngrok tunnel for local URLs and stream progress via Socket.IO.
96
+ - **Session Management**: Resume conversations and test sessions
97
+ - **Artifact Storage**: Screenshots, logs, and reports saved locally
98
+ - **Mode Switching**: Seamlessly switch between UI and API testing
99
+ - **Legacy Command Support**: Existing commands still work with chat integration
104
100
 
105
- ## Authentication
101
+ ## Usage Examples
106
102
 
107
- - **Interactive**: `ttt login` opens the browser and stores a Firebase ID token in `~/.timetotest/config.json`.
108
- - **Headless/CI**: Use Firebase Email/Password (service user):
103
+ ### Interactive Chat Mode
109
104
 
110
105
  ```bash
111
- ttt login --email "$TTT_EMAIL" --password "$TTT_PASSWORD" --api-key "$TTT_FIREBASE_API_KEY"
106
+ # Start a conversation with the AI agent
107
+ ttt
108
+
109
+ # The agent will help you:
110
+ # - Discover your application
111
+ # - Plan test scenarios
112
+ # - Execute tests locally
113
+ # - Generate reports
112
114
  ```
113
115
 
114
- - **Direct token**: `ttt login --token <FIREBASE_ID_TOKEN>`
115
- - **Env override**: Set `TTT_TOKEN` to inject the token for one-off runs.
116
-
117
- ## Commands
118
-
119
- - **ttt login**
120
-
121
- - Options:
122
- - `--device` (reserved)
123
- - `--email <email> --password <password> --api-key <firebase-web-api-key>`
124
- - `--token <FIREBASE_ID_TOKEN>`
125
-
126
- - **ttt test**
116
+ ### Direct Testing
127
117
 
128
- - Starts a test and subscribes to real-time events.
129
- - Key options:
130
- - `--url <ui-url>`: app URL under test (required for UI/mixed)
131
- - `--type <ui|api|mixed>`: defaults to `ui`
132
- - `--execute`: execute generated test cases
133
- - `--mode <all|priority|failed_only>`: defaults to `priority`
134
- - `--project-id <id>` / `--team-id <id>`
135
- - `--docs-url <openapi-url>`: API docs (OpenAPI/Swagger)
136
- - `--no-tunnel`: disable auto ngrok tunnel for local URLs
137
- - `--report [path]`: download PDF on completion (default `./report-<id>.pdf`)
138
- - `--share`: enable public sharing after completion
139
- - `--wait`: block until completion and set exit code based on result
140
-
141
- - **ttt start-test <prompt>**
142
-
143
- - Start a test from a natural language prompt. The backend derives the URL from your selected/last project, so you don't need to pass `--url`.
144
- - Examples:
145
- ```bash
146
- ttt start-test "Smoke test the main user journey and generate a PDF report" --execute --wait
147
- ttt start-test "API regression for orders endpoints" --type api --docs-url https://api.example.com/openapi.json --execute
148
- ```
149
- - Options:
150
- - `--type <ui|api|mixed>`: defaults to `ui`
151
- - `--execute`: execute generated test cases
152
- - `--mode <all|priority|failed_only>`: defaults to `priority`
153
- - `--project-id <id>` / `--team-id <id>`
154
- - `--docs-url <openapi-url>`: API docs (OpenAPI/Swagger)
155
- - `--report [path]`: download PDF on completion (default `./report-<id>.pdf`)
156
- - `--share`: enable public sharing after completion
157
- - `--wait`: block until completion and set exit code based on result
158
-
159
- - **ttt stream <test-id>**
160
-
161
- - Attach to an existing test and print textual progress only.
162
-
163
- - **ttt status <test-id>**
118
+ ```bash
119
+ # Test a web application
120
+ ttt test --url http://localhost:3000 --prompt "Test the shopping cart functionality"
164
121
 
165
- - Print the test status JSON.
122
+ # Test an API
123
+ ttt test --url https://api.myapp.com --type api --prompt "Validate all user endpoints"
166
124
 
167
- - **ttt restart <test-id>**
125
+ # Generate a comprehensive report
126
+ ttt test --url http://localhost:3000 --prompt "Full regression test" --report ./test-report.pdf
127
+ ```
168
128
 
169
- - Re-run a completed or failed test.
129
+ ### Session Management
170
130
 
171
- - **ttt report <test-id> --out <file.pdf>**
131
+ ```bash
132
+ # List your test sessions
133
+ ttt list-sessions
172
134
 
173
- - Create (if needed) and download a PDF report.
135
+ # Resume a previous session
136
+ ttt resume session-123
174
137
 
175
- - **ttt share <test-id>**
176
- - Enable public sharing and print the public URL.
138
+ # Clear old sessions
139
+ ttt clear-session session-123
140
+ ```
177
141
 
178
- ## Real-time Streaming
142
+ ## Configuration
179
143
 
180
- The CLI connects to Socket.IO at `/socket.io` and emits `subscribe_test` with the test ID. It prints minimal, time-stamped lines for events like `test_started`, `test_progress`, `test_completed`, `test_failed`.
144
+ ### Environment Variables
181
145
 
182
- If websockets are blocked, use `ttt status <id>` to poll.
146
+ ```bash
147
+ # Default to local mode (no need to set)
148
+ export TTT_MODE=local
183
149
 
184
- ## Tunnels (Local URLs)
150
+ # Force cloud mode
151
+ export TTT_MODE=remote
185
152
 
186
- When `--url` (or `--docs-url`) points to `localhost`/`127.0.0.1`, the CLI auto-starts an ngrok tunnel and injects the public URL into the request. For reliability, provide an ngrok authtoken:
153
+ # Backend API configuration
154
+ export TTT_API_URL=https://api.timetotest.tech
155
+ export TTT_TOKEN=your-firebase-token
187
156
 
188
- ```bash
189
- export TTT_NGROK_AUTHTOKEN=... # optional but recommended
157
+ # Allow network access in local mode (optional)
158
+ export TTT_ALLOW_NET=true
190
159
  ```
191
160
 
192
- ## Configuration
161
+ ### Authentication
193
162
 
194
- - **Precedence**: CLI flags > environment variables > config file.
195
- - **Config file**: `~/.timetotest/config.json`
163
+ ```bash
164
+ # Interactive login
165
+ ttt login
196
166
 
197
- Example (values are examples; your file will reflect your environment):
167
+ # Headless login (for CI/CD)
168
+ ttt login --email user@example.com --password password --api-key firebase-key
198
169
 
199
- ```json
200
- {
201
- "apiUrl": "https://api.timetotest.tech",
202
- "socketUrl": "https://api.timetotest.tech",
203
- "auth": {"firebaseIdToken": "...", "expiresAt": 0},
204
- "defaultProjectId": null,
205
- "defaultTeamId": null,
206
- "ngrok": {"authtoken": null}
207
- }
170
+ # Direct token
171
+ ttt login --token your-firebase-token
208
172
  ```
209
173
 
210
- ## Environment Variables
211
-
212
- - `TTT_API_URL` – override API base URL
213
- - `TTT_SOCKET_URL` – override Socket.IO base URL
214
- - `TTT_TOKEN` – Firebase ID token (overrides stored token)
215
- - `TTT_NGROK_AUTHTOKEN` – ngrok account token
174
+ ## Integration Examples
216
175
 
217
- ## GitHub Actions (Example)
176
+ ### GitHub Actions
218
177
 
219
178
  ```yaml
220
- name: Time to Test
221
- on:
222
- push:
223
- branches: [main]
179
+ name: AI-Powered Testing
180
+ on: [push, pull_request]
224
181
 
225
182
  jobs:
226
- ttt:
183
+ test:
227
184
  runs-on: ubuntu-latest
228
185
  steps:
229
186
  - uses: actions/checkout@v4
230
- - uses: actions/setup-node@v4
187
+
188
+ - name: Setup Node.js
189
+ uses: actions/setup-node@v4
231
190
  with:
232
191
  node-version: "20"
233
192
 
234
193
  - name: Install CLI
235
- run: npm i -g @timetotest/cli
194
+ run: npm install -g @timetotest/cli
236
195
 
237
- - name: Start App Under Test
196
+ - name: Start Application
238
197
  run: |
239
198
  npm ci
240
- npm run build --if-present
199
+ npm run build
241
200
  npm start &
242
- echo $! > app.pid
243
- npx wait-on http://localhost:3000
201
+ sleep 10
244
202
 
245
- - name: CLI Login (headless)
203
+ - name: Login to Time to Test
246
204
  env:
247
205
  TTT_EMAIL: ${{ secrets.TTT_EMAIL }}
248
206
  TTT_PASSWORD: ${{ secrets.TTT_PASSWORD }}
249
207
  TTT_FIREBASE_API_KEY: ${{ secrets.TTT_FIREBASE_API_KEY }}
250
208
  run: ttt login --email "$TTT_EMAIL" --password "$TTT_PASSWORD" --api-key "$TTT_FIREBASE_API_KEY"
251
209
 
252
- - name: Run Test
253
- env:
254
- TTT_API_URL: https://apis.timetotest.afloattech.com
255
- TTT_SOCKET_URL: https://apis.timetotest.afloattech.com
256
- TTT_NGROK_AUTHTOKEN: ${{ secrets.NGROK_AUTHTOKEN }}
210
+ - name: Run AI Tests
257
211
  run: |
258
212
  ttt test \
259
213
  --url http://localhost:3000 \
260
- --type ui \
261
- --execute \
262
- --mode priority \
263
- --project-id 123 \
264
- --team-id 456 \
265
- --report ./report.pdf \
214
+ --prompt "Comprehensive regression test for main user flows" \
215
+ --report ./test-report.pdf \
266
216
  --wait
267
217
 
268
- - name: Upload Report (PDF)
218
+ - name: Upload Test Report
269
219
  uses: actions/upload-artifact@v4
270
220
  with:
271
- name: timetotest-report
272
- path: ./report.pdf
221
+ name: test-report
222
+ path: ./test-report.pdf
223
+ ```
224
+
225
+ ### Local Development Workflow
273
226
 
274
- - name: Stop App
275
- if: always()
276
- run: kill $(cat app.pid) || true
227
+ ```bash
228
+ # Start your app
229
+ npm start
230
+
231
+ # In another terminal, test it
232
+ ttt test --url http://localhost:3000 --prompt "Test the new feature I just built"
233
+
234
+ # Get a detailed report
235
+ ttt test --url http://localhost:3000 --prompt "Full test suite" --report ./reports/latest.pdf
277
236
  ```
278
237
 
279
- ## Troubleshooting
238
+ ## Commands Reference
239
+
240
+ ### Core Commands
280
241
 
281
- - **401 Unauthorized**: run `ttt login` again or set `TTT_TOKEN`.
282
- - **Tunnel issues**: set `TTT_NGROK_AUTHTOKEN`, ensure your local app is running and reachable.
283
- - **Socket blocked**: use `ttt status <id>` for polling.
284
- - **PDF not saving**: ensure the output path is writable.
242
+ - `ttt` - Start interactive chat (local mode)
243
+ - `ttt --cloud` - Start interactive chat (cloud mode)
244
+ - `ttt test` - Run a specific test with options
245
+ - `ttt login` - Authenticate with Time to Test
246
+
247
+ ### Session Management
248
+
249
+ - `ttt list-sessions` - Show all test sessions
250
+ - `ttt resume <session-id>` - Continue a previous session
251
+ - `ttt clear-session <session-id>` - Delete a session
252
+
253
+ ### Legacy Commands (Still Supported)
254
+
255
+ - `ttt start-test <prompt>` - Start test from prompt
256
+ - `ttt stream <test-id>` - Monitor test progress
257
+ - `ttt status <test-id>` - Check test status
258
+ - `ttt report <test-id>` - Generate report
259
+ - `ttt share <test-id>` - Create shareable link
260
+
261
+ ## What Makes This Different?
262
+
263
+ ### Traditional Testing Tools
264
+
265
+ - Require writing test code
266
+ - Need manual test case creation
267
+ - Limited to predefined scenarios
268
+ - Complex setup and maintenance
269
+
270
+ ### Time to Test CLI
271
+
272
+ - Natural language test descriptions
273
+ - AI discovers test scenarios automatically
274
+ - Adapts to your application's behavior
275
+ - Zero configuration for local testing
285
276
 
286
277
  ## Privacy & Security
287
278
 
288
- - Your token is stored in `~/.timetotest/config.json` with restricted permissions.
289
- - The CLI avoids logging secrets; still, prefer not to paste sensitive URLs directly in shared logs.
279
+ - **Local Mode**: All testing happens on your machine
280
+ - **No Data Collection**: Your application data stays private
281
+ - **Secure Authentication**: Firebase-based auth with token management
282
+ - **Configurable Access**: Control what the agent can access
283
+
284
+ ## Getting Help
285
+
286
+ - **Documentation**: [timetotest.tech](https://timetotest.tech)
287
+ - **Support**: Visit our website for help and updates
288
+ - **Issues**: Report bugs and feature requests through our support channels
289
+
290
+ ## Requirements
290
291
 
291
- ## Feedback
292
+ - **Node.js**: 18 or higher
293
+ - **Operating System**: macOS, Linux, or Windows
294
+ - **Browser**: Chrome/Chromium (for UI testing)
295
+ - **Network**: Internet connection for AI reasoning (local execution)
292
296
 
293
- We’d love to hear from you. Visit [Time to Test](https://timetotest.tech) for updates and support.
297
+ ---
298
+
299
+ **Ready to revolutionize your testing workflow?** Install the CLI and start chatting with your AI testing agent today!
300
+
301
+ ```bash
302
+ npm install -g @timetotest/cli
303
+ ttt
304
+ ```
package/dist/bin/ttt.js CHANGED
@@ -8,10 +8,11 @@ import { restart } from "../src/commands/restart.js";
8
8
  import { stream } from "../src/commands/stream.js";
9
9
  import { report } from "../src/commands/report.js";
10
10
  import { share } from "../src/commands/share.js";
11
- import { ask } from "../src/commands/ask.js";
11
+ import { askInk as ask } from "../src/commands/ask-ink.js";
12
12
  import { startTest } from "../src/commands/start-test.js";
13
13
  import { applyStyledHelpRecursively } from "../src/lib/help.js";
14
14
  import { promptForUpdateIfAvailable } from "../src/lib/update.js";
15
+ import { chatInk as chat } from "../src/commands/chat-ink.js";
15
16
  const program = new Command();
16
17
  const cliVersion = String(packageJson.version || "0.0.0");
17
18
  program.name("ttt").description("Time to Test CLI").version(cliVersion);
@@ -24,11 +25,12 @@ program.addCommand(report);
24
25
  program.addCommand(share);
25
26
  program.addCommand(ask);
26
27
  program.addCommand(startTest);
28
+ program.addCommand(chat);
27
29
  applyStyledHelpRecursively(program, "ttt");
28
30
  await promptForUpdateIfAvailable();
29
31
  // Default to `ask` when no subcommand is provided
30
32
  if (process.argv.length <= 2) {
31
- process.argv.push("ask");
33
+ process.argv.push("chat");
32
34
  }
33
35
  await program.parseAsync(process.argv);
34
36
  //# sourceMappingURL=ttt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":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.2.1",
4
4
  "description": "Time to Test CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -29,25 +29,36 @@
29
29
  "node": ">=18"
30
30
  },
31
31
  "dependencies": {
32
+ "@modelcontextprotocol/sdk": "^1.20.1",
32
33
  "@ngrok/ngrok": "^1.3.0",
34
+ "@playwright/mcp": "^0.0.43",
33
35
  "axios": "^1.7.7",
34
36
  "chalk": "^5.3.0",
37
+ "cloudinary": "^2.8.0",
35
38
  "commander": "^12.1.0",
36
39
  "dotenv": "^16.4.5",
37
40
  "figlet": "^1.6.0",
38
41
  "fs-extra": "^11.2.0",
42
+ "fuse.js": "^7.1.0",
43
+ "ink": "^6.3.1",
44
+ "ink-spinner": "^5.0.0",
45
+ "ink-text-input": "^6.0.0",
39
46
  "inquirer": "^9.2.12",
40
47
  "keytar": "^7.9.0",
41
48
  "open": "^9.1.0",
42
49
  "ora": "^8.1.0",
50
+ "playwright": "^1.56.1",
51
+ "react": "^19.2.0",
43
52
  "readline": "^1.3.0",
44
- "socket.io-client": "^4.7.5"
53
+ "socket.io-client": "^4.7.5",
54
+ "yaml": "^2.8.1"
45
55
  },
46
56
  "devDependencies": {
47
57
  "@types/figlet": "^1.5.8",
48
58
  "@types/fs-extra": "^11.0.4",
49
59
  "@types/inquirer": "^9.0.9",
50
60
  "@types/node": "^20.11.19",
61
+ "@types/react": "^19.2.2",
51
62
  "typescript": "^5.5.4"
52
63
  }
53
64
  }