@snapcommit/cli 3.8.20 → 3.8.21

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.
@@ -8,7 +8,7 @@ exports.interpretGitCommand = interpretGitCommand;
8
8
  exports.suggestNextActions = suggestNextActions;
9
9
  const auth_1 = require("../lib/auth");
10
10
  // API URL - defaults to production
11
- const API_BASE_URL = process.env.SNAPCOMMIT_API_URL || 'https://snapcommit.dev';
11
+ const API_BASE_URL = process.env.SNAPCOMMIT_API_URL || 'https://www.snapcommit.dev';
12
12
  /**
13
13
  * Interpret natural language command using backend API
14
14
  */
@@ -33,7 +33,7 @@ async function interpretGitCommand(userInput, context) {
33
33
  throw new Error('Authentication failed. Please log in again: snapcommit logout && snapcommit login');
34
34
  }
35
35
  if (response.status === 403) {
36
- throw new Error(data.message || 'Subscription required. Visit https://snapcommit.dev/pricing');
36
+ throw new Error(data.message || 'Subscription required. Visit https://www.snapcommit.dev/pricing');
37
37
  }
38
38
  throw new Error(data.error || 'Failed to interpret command');
39
39
  }
@@ -70,7 +70,7 @@ function statusCommand() {
70
70
  console.log(chalk_1.default.gray(' • Advanced stats'));
71
71
  console.log(chalk_1.default.gray(' • Priority support'));
72
72
  console.log();
73
- console.log(chalk_1.default.white('Visit: ') + chalk_1.default.cyan('https://snapcommit.dev/pricing'));
73
+ console.log(chalk_1.default.white('Visit: ') + chalk_1.default.cyan('https://www.snapcommit.dev/pricing'));
74
74
  console.log();
75
75
  return;
76
76
  }
@@ -82,11 +82,11 @@ function statusCommand() {
82
82
  const usage = require('../license/manager').getTrialStatus();
83
83
  if (usage.isExpired) {
84
84
  console.log(chalk_1.default.red('❌ Your trial has expired!'));
85
- console.log(chalk_1.default.white('Upgrade: ') + chalk_1.default.cyan('https://snapcommit.dev/pricing'));
85
+ console.log(chalk_1.default.white('Upgrade: ') + chalk_1.default.cyan('https://www.snapcommit.dev/pricing'));
86
86
  }
87
87
  else {
88
88
  console.log(chalk_1.default.yellow(`💡 ${usage.daysRemaining} day${usage.daysRemaining === 1 ? '' : 's'} left in your trial!`));
89
- console.log(chalk_1.default.white('Upgrade: ') + chalk_1.default.cyan('https://snapcommit.dev/pricing'));
89
+ console.log(chalk_1.default.white('Upgrade: ') + chalk_1.default.cyan('https://www.snapcommit.dev/pricing'));
90
90
  }
91
91
  }
92
92
  else {
@@ -57,7 +57,7 @@ async function commitCommand() {
57
57
  console.log(chalk_1.default.gray(' • $9.99/month or $100/year'));
58
58
  console.log(chalk_1.default.gray(' • Unlimited AI commits'));
59
59
  console.log();
60
- console.log(chalk_1.default.white('Visit: ') + chalk_1.default.cyan('https://snapcommit.dev/pricing'));
60
+ console.log(chalk_1.default.white('Visit: ') + chalk_1.default.cyan('https://www.snapcommit.dev/pricing'));
61
61
  console.log();
62
62
  return;
63
63
  }
@@ -72,7 +72,7 @@ async function commitCommand() {
72
72
  console.log();
73
73
  if (userPlan === 'free') {
74
74
  console.log(chalk_1.default.yellow('💡 Pro users have 10x higher limits!'));
75
- console.log(chalk_1.default.white(' Visit: ') + chalk_1.default.cyan('https://snapcommit.dev/pricing'));
75
+ console.log(chalk_1.default.white(' Visit: ') + chalk_1.default.cyan('https://www.snapcommit.dev/pricing'));
76
76
  }
77
77
  console.log();
78
78
  return;
@@ -232,7 +232,7 @@ async function commitCommand() {
232
232
  // Show upgrade message for trial users (last 2 days)
233
233
  if (!(0, manager_1.isProUser)() && usage && !usage.isExpired && usage.daysRemaining <= 2) {
234
234
  console.log(chalk_1.default.yellow(`⚠️ Only ${usage.daysRemaining} day${usage.daysRemaining === 1 ? '' : 's'} left in your trial!`));
235
- console.log(chalk_1.default.gray(' Upgrade to Pro: https://snapcommit.dev/pricing\n'));
235
+ console.log(chalk_1.default.gray(' Upgrade to Pro: https://www.snapcommit.dev/pricing\n'));
236
236
  }
237
237
  }
238
238
  catch (error) {
@@ -542,7 +542,7 @@ async function resolveConflictWithAI(filename, base, ours, theirs) {
542
542
  return null;
543
543
  }
544
544
  // Get the backend URL from env or default
545
- const backendUrl = process.env.SNAPCOMMIT_BACKEND_URL || 'https://snapcommit.dev';
545
+ const backendUrl = process.env.SNAPCOMMIT_BACKEND_URL || 'https://www.snapcommit.dev';
546
546
  const response = await axios.post(`${backendUrl}/api/ai/resolve-conflict`, {
547
547
  filename,
548
548
  base,
@@ -564,7 +564,7 @@ async function resolveConflictWithAI(filename, base, ours, theirs) {
564
564
  // AI resolution failed - fall back to manual choice
565
565
  if (error.response?.status === 403) {
566
566
  console.log(chalk_1.default.red('\n❌ Subscription required for AI conflict resolution'));
567
- console.log(chalk_1.default.cyan('Visit: https://snapcommit.dev/pricing\n'));
567
+ console.log(chalk_1.default.cyan('Visit: https://www.snapcommit.dev/pricing\n'));
568
568
  }
569
569
  return null;
570
570
  }
@@ -901,7 +901,7 @@ async function getAIInterpretation(userInput, token) {
901
901
  try {
902
902
  const currentBranch = (0, git_1.getCurrentBranch)();
903
903
  const status = (0, git_1.getGitStatus)();
904
- const response = await fetch('https://snapcommit.dev/api/ai/interpret', {
904
+ const response = await fetch('https://www.snapcommit.dev/api/ai/interpret', {
905
905
  method: 'POST',
906
906
  headers: { 'Content-Type': 'application/json' },
907
907
  body: JSON.stringify({
@@ -935,7 +935,7 @@ async function generateCommitMessage(diff) {
935
935
  if (diff.length > 40000) {
936
936
  diff = diff.substring(0, 40000);
937
937
  }
938
- const response = await fetch('https://snapcommit.dev/api/ai/commit', {
938
+ const response = await fetch('https://www.snapcommit.dev/api/ai/commit', {
939
939
  method: 'POST',
940
940
  headers: { 'Content-Type': 'application/json' },
941
941
  body: JSON.stringify({ diff, token }),
@@ -87,7 +87,7 @@ async function autoFetchGitHubToken() {
87
87
  return null;
88
88
  }
89
89
  // Call SnapCommit API to get GitHub OAuth token
90
- const response = await fetch('https://snapcommit.dev/api/github/token', {
90
+ const response = await fetch('https://www.snapcommit.dev/api/github/token', {
91
91
  method: 'GET',
92
92
  headers: {
93
93
  'Authorization': `Bearer ${authConfig.token}`,
@@ -234,7 +234,7 @@ async function githubConnectCommand(tokenArg) {
234
234
  console.log(chalk_1.default.cyan('🔄 Getting GitHub OAuth URL...\n'));
235
235
  try {
236
236
  // Call API to get OAuth URL
237
- const response = await fetch('https://snapcommit.dev/api/github/connect', {
237
+ const response = await fetch('https://www.snapcommit.dev/api/github/connect', {
238
238
  method: 'POST',
239
239
  headers: {
240
240
  'Content-Type': 'application/json',
@@ -79,7 +79,7 @@ async function onboardCommand() {
79
79
  console.log();
80
80
  console.log(chalk_1.default.yellow.bold('💡 Pro tip: ') + chalk_1.default.white('Use') + chalk_1.default.cyan(' bq ') + chalk_1.default.white('for instant commits!'));
81
81
  console.log();
82
- console.log(chalk_1.default.gray('Need help? → ') + chalk_1.default.cyan('https://snapcommit.dev/docs'));
82
+ console.log(chalk_1.default.gray('Need help? → ') + chalk_1.default.cyan('https://www.snapcommit.dev/docs'));
83
83
  console.log();
84
84
  }
85
85
  async function pressEnter() {
@@ -10,7 +10,7 @@ const database_1 = require("../db/database");
10
10
  const auth_1 = require("../lib/auth");
11
11
  const analytics_1 = require("../utils/analytics");
12
12
  // API URL - defaults to production, can be overridden for development
13
- const API_BASE_URL = process.env.SNAPCOMMIT_API_URL || 'https://snapcommit.dev';
13
+ const API_BASE_URL = process.env.SNAPCOMMIT_API_URL || 'https://www.snapcommit.dev';
14
14
  /**
15
15
  * Generate commit message using backend API
16
16
  */
@@ -27,7 +27,7 @@ async function generateCommitMessageAPI(diff, token) {
27
27
  throw new Error('Authentication failed. Please log in again: snapcommit logout && snapcommit');
28
28
  }
29
29
  if (response.status === 403) {
30
- throw new Error(data.message || 'Subscription required. Visit https://snapcommit.dev/pricing');
30
+ throw new Error(data.message || 'Subscription required. Visit https://www.snapcommit.dev/pricing');
31
31
  }
32
32
  if (response.status === 429) {
33
33
  throw new Error(data.error || 'Rate limit exceeded');
package/dist/lib/auth.js CHANGED
@@ -18,7 +18,7 @@ const readline_1 = __importDefault(require("readline"));
18
18
  const CONFIG_DIR = path_1.default.join(os_1.default.homedir(), '.snapcommit');
19
19
  const AUTH_FILE = path_1.default.join(CONFIG_DIR, 'auth.json');
20
20
  // API URL - defaults to production, can be overridden for development
21
- const API_BASE_URL = process.env.SNAPCOMMIT_API_URL || 'https://snapcommit.dev';
21
+ const API_BASE_URL = process.env.SNAPCOMMIT_API_URL || 'https://www.snapcommit.dev';
22
22
  // Token validation cache
23
23
  let lastValidationTime = 0;
24
24
  const VALIDATION_INTERVAL = 60 * 60 * 1000; // 1 hour in milliseconds
@@ -105,11 +105,11 @@ async function promptAuth() {
105
105
  console.log(chalk_1.default.gray('SnapCommit needs authentication to provide AI-powered features.\n'));
106
106
  console.log(chalk_1.default.yellow('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
107
107
  console.log(chalk_1.default.bold.white('Step 1: ') + chalk_1.default.gray('Sign in with GitHub (one-click!)'));
108
- console.log(chalk_1.default.cyan(' 👉 https://snapcommit.dev/login\n'));
108
+ console.log(chalk_1.default.cyan(' 👉 https://www.snapcommit.dev/login\n'));
109
109
  console.log(chalk_1.default.bold.white('Step 2: ') + chalk_1.default.gray('Subscribe ($9.99/mo or $100/year)'));
110
110
  console.log(chalk_1.default.cyan(' 👉 Choose your plan on the dashboard\n'));
111
111
  console.log(chalk_1.default.bold.white('Step 3: ') + chalk_1.default.gray('Generate & paste your CLI token'));
112
- console.log(chalk_1.default.cyan(' 👉 https://snapcommit.dev/dashboard\n'));
112
+ console.log(chalk_1.default.cyan(' 👉 https://www.snapcommit.dev/dashboard\n'));
113
113
  console.log(chalk_1.default.yellow('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
114
114
  const token = await askQuestion(chalk_1.default.yellow('🔑 Paste your authentication token: '));
115
115
  if (!token || token.trim().length === 0) {
@@ -151,7 +151,7 @@ async function promptAuth() {
151
151
  console.log(chalk_1.default.red('\n❌ Invalid token. Please try again.\n'));
152
152
  console.log(chalk_1.default.yellow('Troubleshooting:'));
153
153
  console.log(chalk_1.default.gray(' • Make sure you copied the ENTIRE token'));
154
- console.log(chalk_1.default.gray(' • Generate a new token at: https://snapcommit.dev/dashboard'));
154
+ console.log(chalk_1.default.gray(' • Generate a new token at: https://www.snapcommit.dev/dashboard'));
155
155
  console.log(chalk_1.default.gray(' • Ensure you have an active SnapCommit subscription\n'));
156
156
  return false;
157
157
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapcommit/cli",
3
- "version": "3.8.20",
3
+ "version": "3.8.21",
4
4
  "description": "Instant AI commits. Beautiful progress tracking. Never write commit messages again.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {