shai-cli 0.1.0 → 0.2.0

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.
data/lib/shai.rb CHANGED
@@ -4,6 +4,7 @@ require_relative "shai/version"
4
4
  require_relative "shai/configuration"
5
5
  require_relative "shai/credentials"
6
6
  require_relative "shai/api_client"
7
+ require_relative "shai/installed_projects"
7
8
  require_relative "shai/cli"
8
9
 
9
10
  module Shai
@@ -19,6 +20,41 @@ module Shai
19
20
 
20
21
  class InvalidConfigurationError < Error; end
21
22
 
23
+ class RateLimitError < Error
24
+ attr_reader :retry_after
25
+
26
+ def initialize(message = "Too many requests", retry_after: nil)
27
+ @retry_after = retry_after
28
+ super(message)
29
+ end
30
+ end
31
+
32
+ class DeviceFlowError < Error
33
+ attr_reader :error_code, :interval
34
+
35
+ def initialize(error_code, interval: nil)
36
+ @error_code = error_code
37
+ @interval = interval
38
+ super(error_code)
39
+ end
40
+
41
+ def authorization_pending?
42
+ error_code == "authorization_pending"
43
+ end
44
+
45
+ def slow_down?
46
+ error_code == "slow_down"
47
+ end
48
+
49
+ def access_denied?
50
+ error_code == "access_denied"
51
+ end
52
+
53
+ def expired?
54
+ error_code == "expired_token"
55
+ end
56
+ end
57
+
22
58
  # Exit codes as specified in tech spec
23
59
  EXIT_SUCCESS = 0
24
60
  EXIT_GENERAL_ERROR = 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shai-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Jimenez
@@ -107,6 +107,20 @@ dependencies:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
109
  version: '3.4'
110
+ - !ruby/object:Gem::Dependency
111
+ name: launchy
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '2.5'
117
+ type: :runtime
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '2.5'
110
124
  description: A command-line interface for shaicli.dev - download, share, and sync
111
125
  AI agent configurations (Claude, Cursor, etc.) across projects and teams.
112
126
  email:
@@ -128,6 +142,7 @@ files:
128
142
  - lib/shai/commands/sync.rb
129
143
  - lib/shai/configuration.rb
130
144
  - lib/shai/credentials.rb
145
+ - lib/shai/installed_projects.rb
131
146
  - lib/shai/ui.rb
132
147
  - lib/shai/version.rb
133
148
  homepage: https://shaicli.dev