elelem-shell 0.3.0 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8bf4f811566109ceeeb2b8271badc16da212f16f5a9b6c484fee6d2041df8bc
4
- data.tar.gz: c47376d659474303125b372231ae206ceb9e5d12ebb519fa9884d24ed607a979
3
+ metadata.gz: 95a18cd5402e8360cfc442a502d012b3f18e37a32e73a1ef97acd60aba9ff197
4
+ data.tar.gz: a3a7bf70fcda3a2519708edb7a59ad4b91fca500ed6fc6ad4270b6c8c5fb1025
5
5
  SHA512:
6
- metadata.gz: d9fba347d65a348c08d889450203dc943bcc45390492160f0476a8696354ad41ce28fc6e36c064beb61b2df0bc766abad4caee868f2350d2fc59213dc0524e06
7
- data.tar.gz: 4afcf1c2d9024f4f358dd927fc22800b2f56bfd5c93f798b6256cc54fff73ff136bc99ccf8a323b3b65d343ac9824af868df36e4ca823f96e799cc2766d9da4a
6
+ metadata.gz: ab85661cb09c6971b2db19d00a5070e7ea515462215beee232df57dc2be20385fc1828d24e6d58942387bd54c5c7523b449c4adc5cadcc545d29621e4198501d
7
+ data.tar.gz: 64e4c9d15a6672ccc116ac0c540ec04d4fb8d4412f8fac0bdca05e5c6461481fde495f655b8cb5473384d1efae9acaf0676d855035230f83fcd4a51f3859e865
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2026 mo khan
3
+ Copyright (c) 2026 2809074 Alberta Ltd.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Elelem
4
4
  module Shell
5
- VERSION = "0.3.0"
5
+ VERSION = "0.4.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elelem-shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo khan
@@ -15,7 +15,7 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '0.14'
18
+ version: '0.17'
19
19
  - - "<"
20
20
  - !ruby/object:Gem::Version
21
21
  version: '1'
@@ -25,7 +25,7 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: '0.14'
28
+ version: '0.17'
29
29
  - - "<"
30
30
  - !ruby/object:Gem::Version
31
31
  version: '1'
@@ -319,23 +319,11 @@ executables:
319
319
  extensions: []
320
320
  extra_rdoc_files: []
321
321
  files:
322
- - ".github/workflows/release.yml"
323
- - ".release-please-manifest.json"
324
- - ".rspec"
325
- - ".rubocop.yml"
326
- - CHANGELOG.md
327
322
  - LICENSE.txt
328
- - README.md
329
- - Rakefile
330
323
  - exe/elelem-shell
331
324
  - lib/elelem/shell.rb
332
325
  - lib/elelem/shell/default_provider.rb
333
326
  - lib/elelem/shell/version.rb
334
- - release-please-config.json
335
- - spec/elelem/default_provider_spec.rb
336
- - spec/elelem/exe_spec.rb
337
- - spec/elelem/shell_spec.rb
338
- - spec/spec_helper.rb
339
327
  homepage: https://elelem.sh
340
328
  licenses:
341
329
  - MIT
@@ -1,64 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- workflow_dispatch:
7
-
8
- permissions: {}
9
-
10
- concurrency:
11
- group: release
12
- cancel-in-progress: false
13
-
14
- jobs:
15
- test:
16
- runs-on: ubuntu-latest
17
- permissions:
18
- contents: read
19
- steps:
20
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
21
- with:
22
- persist-credentials: false
23
- - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
24
- with:
25
- ruby-version: "4.0"
26
- bundler-cache: true
27
- - run: bin/test
28
- - run: bin/lint
29
-
30
- release-please:
31
- needs: test
32
- runs-on: ubuntu-latest
33
- permissions:
34
- contents: write
35
- issues: write
36
- pull-requests: write
37
- outputs:
38
- release_created: ${{ steps.release.outputs.release_created }}
39
- steps:
40
- - id: release
41
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
42
- with:
43
- config-file: release-please-config.json
44
- manifest-file: .release-please-manifest.json
45
- target-branch: main
46
-
47
- publish:
48
- needs: release-please
49
- if: needs.release-please.outputs.release_created == 'true'
50
- runs-on: ubuntu-latest
51
- permissions:
52
- contents: write
53
- id-token: write
54
- steps:
55
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
56
- with:
57
- persist-credentials: false
58
- - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
59
- with:
60
- ruby-version: "4.0"
61
- bundler-cache: true
62
- - uses: rubygems/release-gem@7f9650160c1a4e7989fdc9855807bdbd421d8b6b # v1.4.1
63
- with:
64
- await-release: false
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.3.0"
3
- }
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,62 +0,0 @@
1
- AllCops:
2
- NewCops: enable
3
- TargetRubyVersion: 4.0
4
- SuggestExtensions: false
5
- Exclude:
6
- - "pkg/**/*"
7
- - "bin/**/*"
8
- - "vendor/**/*"
9
- - "fixtures/**/*"
10
-
11
- Metrics:
12
- Enabled: false
13
-
14
- Naming/PredicateMethod:
15
- AllowedMethods:
16
- - call
17
- - run
18
- - summarize
19
- - prompt
20
-
21
- Naming/MethodParameterName:
22
- AllowedNames:
23
- - me
24
- - id
25
- - as
26
- - io
27
-
28
- Style/GlobalVars:
29
- Exclude:
30
- - "spec/**/*"
31
-
32
- Lint/EmptyBlock:
33
- Exclude:
34
- - "spec/**/*"
35
-
36
- Lint/UselessDefaultValueArgument:
37
- Enabled: false
38
-
39
- Lint/RedundantRequireStatement:
40
- Enabled: false
41
-
42
- Lint/UnusedBlockArgument:
43
- IgnoreEmptyBlocks: true
44
- AllowUnusedKeywordArguments: true
45
-
46
- Style/Documentation:
47
- Enabled: false
48
-
49
- Style/FormatStringToken:
50
- Enabled: false
51
-
52
- Style/FrozenStringLiteralComment:
53
- Enabled: true
54
-
55
- Style/StringLiterals:
56
- EnforcedStyle: double_quotes
57
-
58
- Style/StringLiteralsInInterpolation:
59
- EnforcedStyle: double_quotes
60
-
61
- Layout/LineLength:
62
- Max: 120
data/CHANGELOG.md DELETED
@@ -1,40 +0,0 @@
1
- # Changelog
2
-
3
- ## [0.3.0](https://github.com/elelem-sh/shell/compare/v0.2.1...v0.3.0) (2026-11-20)
4
-
5
-
6
- ### Features
7
-
8
- * detect the openai provider when OPENAI_API_KEY_COMMAND is set ([783dcd2](https://github.com/elelem-sh/shell/commit/783dcd2c1f5eb7a0b451dc48740586ee85c26cd7))
9
-
10
-
11
- ### Bug Fixes
12
-
13
- * require elelem-openai 0.5 for OPENAI_API_KEY_COMMAND ([08e56b7](https://github.com/elelem-sh/shell/commit/08e56b77ef7dbcdd7f58b69cb33335df9c10ef23))
14
-
15
- ## [0.2.1](https://github.com/elelem-sh/shell/compare/v0.2.0...v0.2.1) (2026-11-17)
16
-
17
-
18
- ### Bug Fixes
19
-
20
- * detect a hosted provider only when its model is set too, and treat a blank ELELEM_GGUF_MODEL as unset ([3676ffa](https://github.com/elelem-sh/shell/commit/3676ffa00477fcb21105c2d6b7c8b584350f4a3c))
21
-
22
- ## [0.2.0](https://github.com/elelem-sh/shell/compare/v0.1.0...v0.2.0) (2026-11-17)
23
-
24
-
25
- ### Features
26
-
27
- * default to the provider whose standard API key is set, then a local llama model, then ollama, then demo ([d99680f](https://github.com/elelem-sh/shell/commit/d99680fff2b1f4a7efff62543b50d9aaf2e1ffdb))
28
-
29
- ## 0.1.0 (2026-11-16)
30
-
31
-
32
- ### Features
33
-
34
- * elelem-shell command runs elelem with every bundled plugin loaded ([ec6af32](https://github.com/elelem-sh/shell/commit/ec6af32d00072079ada8d2f39bfdfd24e83f126f))
35
- * elelem-shell installs elelem with tools, mcp, skills and the pure-Ruby providers ([a3da3ed](https://github.com/elelem-sh/shell/commit/a3da3ed389d76dd42f94bf7a45d1155167247318))
36
-
37
-
38
- ### Bug Fixes
39
-
40
- * require elelem 0.14 and the latest released tools and anthropic ([780631b](https://github.com/elelem-sh/shell/commit/780631b8f1a7e9aeb0415cc8a5b5f3701c00455d))
data/README.md DELETED
@@ -1,61 +0,0 @@
1
- # elelem-shell
2
-
3
- One gem that installs [elelem](https://elelem.sh) with its pure Ruby plugins
4
- and providers.
5
-
6
- ## Install
7
-
8
- ```sh
9
- gem install elelem-shell
10
- ```
11
-
12
- Then run `elelem-shell`. It is `elelem` with elelem-tools, elelem-mcp and
13
- elelem-skills loaded.
14
-
15
- ## Default provider
16
-
17
- Pick a provider with `-p NAME`. Without `-p`, the first match wins:
18
-
19
- 1. `ELELEM_PROVIDER`, its value
20
- 2. `ANTHROPIC_API_KEY`, anthropic
21
- 3. `OPENAI_API_KEY` or `OPENAI_BASE_URL`, openai
22
- 4. `GEMINI_API_KEY` and `GEMINI_MODEL`, gemini
23
- 5. `OPENROUTER_API_KEY` and `OPENROUTER_MODEL`, openrouter; `GROQ_API_KEY` and
24
- `GROQ_MODEL`, groq; `MISTRAL_API_KEY` and `MISTRAL_MODEL`, mistral;
25
- `CEREBRAS_API_KEY` and `CEREBRAS_MODEL`, cerebras
26
- 6. `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID` and `CLOUDFLARE_MODEL`,
27
- cloudflare
28
- 7. llama, when elelem-llama is installed and `ELELEM_GGUF_MODEL` is set, or
29
- `~/.agents/models` holds `default.gguf` or exactly one `.gguf` file
30
- 8. `OLLAMA_HOST`, ollama
31
- 9. demo, which calls no model
32
-
33
- A variable that is set but blank counts as unset. The hosted providers in
34
- 4 to 6 have no default model, so their key alone is not enough. `GITHUB_TOKEN`
35
- is not detected; use `-p github`.
36
-
37
- To run it without installing, use [rv](https://rv.dev):
38
-
39
- ```sh
40
- rvx elelem-shell
41
- ```
42
-
43
- ## What it installs
44
-
45
- - elelem
46
- - elelem-tools, elelem-mcp, elelem-skills
47
- - elelem-anthropic, elelem-cerebras, elelem-cloudflare, elelem-gemini,
48
- elelem-github, elelem-groq, elelem-mistral, elelem-ollama, elelem-openai,
49
- elelem-openrouter
50
- - elelem-server, the `elelem-server` web UI
51
-
52
- ## What it leaves out
53
-
54
- - elelem-llama, elelem-ratatui, elelem-candle, elelem-ggml, elelem-llama2 and
55
- elelem-diffusion build native extensions at install time. Install them on
56
- their own when you want them. https://elelem.sh/install installs elelem-llama.
57
- - elelem-evals runs evals against providers. It is for developing elelem.
58
-
59
- ## License
60
-
61
- MIT. See LICENSE.txt.
data/Rakefile DELETED
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- task default: %i[]
@@ -1,12 +0,0 @@
1
- {
2
- "packages": {
3
- ".": {
4
- "release-type": "ruby",
5
- "package-name": "elelem-shell",
6
- "version-file": "lib/elelem/shell/version.rb",
7
- "initial-version": "0.1.0",
8
- "bump-minor-pre-major": true,
9
- "include-component-in-tag": false
10
- }
11
- }
12
- }
@@ -1,141 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "tmpdir"
4
-
5
- RSpec.describe Elelem::Shell do
6
- around do |example|
7
- Dir.mktmpdir do |dir|
8
- @models_dir = dir
9
- example.run
10
- end
11
- end
12
-
13
- def detect(env = {}) = described_class.default_provider(env, models_dir: @models_dir)
14
-
15
- def add_model(name = "tiny.gguf") = File.write(File.join(@models_dir, name), "")
16
-
17
- describe ".default_provider" do
18
- {
19
- "ANTHROPIC_API_KEY" => "anthropic",
20
- "OPENAI_API_KEY" => "openai",
21
- "OPENAI_API_KEY_COMMAND" => "openai",
22
- "OPENAI_BASE_URL" => "openai",
23
- "OLLAMA_HOST" => "ollama"
24
- }.each do |name, provider|
25
- it "picks #{provider} when #{name} is set" do
26
- expect(detect(name => "value")).to eq(provider)
27
- end
28
-
29
- it "ignores a blank #{name}" do
30
- expect(detect(name => " \n")).to eq("demo")
31
- end
32
- end
33
-
34
- {
35
- "gemini" => "GEMINI",
36
- "openrouter" => "OPENROUTER",
37
- "groq" => "GROQ",
38
- "mistral" => "MISTRAL",
39
- "cerebras" => "CEREBRAS"
40
- }.each do |provider, prefix|
41
- it "picks #{provider} when #{prefix}_API_KEY and #{prefix}_MODEL are set" do
42
- expect(detect("#{prefix}_API_KEY" => "key", "#{prefix}_MODEL" => "model")).to eq(provider)
43
- end
44
-
45
- it "ignores #{prefix}_API_KEY without #{prefix}_MODEL, since #{provider} has no default model" do
46
- add_model
47
-
48
- expect(detect("#{prefix}_API_KEY" => "key")).to eq("llama")
49
- end
50
- end
51
-
52
- it "falls back to demo" do
53
- expect(detect).to eq("demo")
54
- end
55
-
56
- it "picks the value of ELELEM_PROVIDER first" do
57
- expect(detect("ELELEM_PROVIDER" => "github", "ANTHROPIC_API_KEY" => "key")).to eq("github")
58
- end
59
-
60
- it "ignores a blank ELELEM_PROVIDER" do
61
- expect(detect("ELELEM_PROVIDER" => " ", "ANTHROPIC_API_KEY" => "key")).to eq("anthropic")
62
- end
63
-
64
- it "prefers the hosted providers in order" do
65
- names = %w[ANTHROPIC_API_KEY OPENAI_API_KEY GEMINI_API_KEY OPENROUTER_API_KEY GROQ_API_KEY MISTRAL_API_KEY
66
- CEREBRAS_API_KEY CLOUDFLARE_API_TOKEN]
67
- models = %w[GEMINI_MODEL OPENROUTER_MODEL GROQ_MODEL MISTRAL_MODEL CEREBRAS_MODEL CLOUDFLARE_MODEL]
68
- env = (names + models + %w[CLOUDFLARE_ACCOUNT_ID]).to_h { |name| [name, "value"] }
69
- picks = names.map { |name| detect(env).tap { env.delete(name) } }
70
-
71
- expect(picks).to eq(%w[anthropic openai gemini openrouter groq mistral cerebras cloudflare])
72
- end
73
-
74
- it "picks cloudflare when the token and the account id are set" do
75
- expect(detect("CLOUDFLARE_API_TOKEN" => "token", "CLOUDFLARE_ACCOUNT_ID" => "id",
76
- "CLOUDFLARE_MODEL" => "model")).to eq("cloudflare")
77
- end
78
-
79
- it "ignores cloudflare without CLOUDFLARE_MODEL" do
80
- expect(detect("CLOUDFLARE_API_TOKEN" => "token", "CLOUDFLARE_ACCOUNT_ID" => "id")).to eq("demo")
81
- end
82
-
83
- it "ignores a cloudflare token without an account id" do
84
- expect(detect("CLOUDFLARE_API_TOKEN" => "token")).to eq("demo")
85
- end
86
-
87
- it "ignores a cloudflare account id without a token" do
88
- expect(detect("CLOUDFLARE_ACCOUNT_ID" => "id", "CLOUDFLARE_API_TOKEN" => "")).to eq("demo")
89
- end
90
-
91
- it "ignores GITHUB_TOKEN and GH_TOKEN" do
92
- expect(detect("GITHUB_TOKEN" => "token", "GH_TOKEN" => "token")).to eq("demo")
93
- end
94
-
95
- it "picks llama when the models directory holds one model" do
96
- add_model
97
-
98
- expect(detect).to eq("llama")
99
- end
100
-
101
- it "picks llama when ELELEM_GGUF_MODEL is set, even to a missing file" do
102
- expect(detect("ELELEM_GGUF_MODEL" => "/nonexistent/model.gguf")).to eq("llama")
103
- end
104
-
105
- it "ignores a blank ELELEM_GGUF_MODEL" do
106
- expect(detect("ELELEM_GGUF_MODEL" => " ")).to eq("demo")
107
- end
108
-
109
- it "ignores a blank ELELEM_GGUF_MODEL and still finds a model in the directory" do
110
- add_model
111
-
112
- expect(detect("ELELEM_GGUF_MODEL" => "")).to eq("llama")
113
- end
114
-
115
- it "skips llama when the models directory holds several models and no default" do
116
- add_model("one.gguf")
117
- add_model("two.gguf")
118
-
119
- expect(detect).to eq("demo")
120
- end
121
-
122
- it "prefers an API key to a local model" do
123
- add_model
124
-
125
- expect(detect("ANTHROPIC_API_KEY" => "key")).to eq("anthropic")
126
- end
127
-
128
- it "prefers a local model to ollama" do
129
- add_model
130
-
131
- expect(detect("OLLAMA_HOST" => "localhost:11434")).to eq("llama")
132
- end
133
-
134
- it "does not load fiddle" do
135
- add_model
136
- detect
137
-
138
- expect($LOADED_FEATURES.grep(%r{/fiddle\.(rb|so)\z})).to be_empty
139
- end
140
- end
141
- end
@@ -1,74 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "open3"
4
- require "tmpdir"
5
-
6
- RSpec.describe "exe/elelem-shell" do
7
- let(:root) { File.expand_path("../..", __dir__) }
8
- let(:detected) do
9
- %w[ELELEM_PROVIDER ANTHROPIC_API_KEY OPENAI_API_KEY OPENAI_BASE_URL GEMINI_API_KEY OPENROUTER_API_KEY
10
- GROQ_API_KEY MISTRAL_API_KEY CEREBRAS_API_KEY CLOUDFLARE_API_TOKEN CLOUDFLARE_ACCOUNT_ID ELELEM_GGUF_MODEL
11
- MISTRAL_MODEL
12
- OLLAMA_HOST]
13
- end
14
-
15
- around do |example|
16
- Dir.mktmpdir do |home|
17
- @home = home
18
- example.run
19
- end
20
- end
21
-
22
- def env(overrides = {})
23
- gems = { "HOME" => @home, "GEM_HOME" => Gem.dir, "GEM_PATH" => Gem.path.join(File::PATH_SEPARATOR) }
24
- detected.to_h { |name| [name, nil] }.merge(gems, overrides)
25
- end
26
-
27
- def run(*, **overrides)
28
- Open3.capture3(env(overrides), RbConfig.ruby, "-I", "#{root}/lib", "#{root}/exe/elelem-shell", *, chdir: root)
29
- end
30
-
31
- it "runs elelem, reading a file with the demo provider" do
32
- output, error, status = run("ask", "@Gemfile")
33
-
34
- expect(status).to be_success
35
- expect(output + error).to include('gemspec name: "elelem-shell"')
36
- end
37
-
38
- it "prints its usage" do
39
- output, _, status = run("help")
40
-
41
- expect(status).to be_success
42
- expect(output).to include("Usage: elelem-shell")
43
- end
44
-
45
- it "shows the detected provider as the default" do
46
- output, = run("help", "MISTRAL_API_KEY" => "key", "MISTRAL_MODEL" => "model")
47
-
48
- expect(output).to include("(default: mistral)")
49
- end
50
-
51
- it "says so when it falls back to the demo provider" do
52
- _, error, = run("help")
53
-
54
- expect(error).to eq("#{Elelem::Shell::NOTICE}\n")
55
- end
56
-
57
- it "stays quiet when a provider is detected" do
58
- _, error, = run("help", "ELELEM_PROVIDER" => "demo")
59
-
60
- expect(error).to be_empty
61
- end
62
-
63
- it "stays quiet when -p picks the provider" do
64
- _, error, = run("help", "-p", "demo")
65
-
66
- expect(error).to be_empty
67
- end
68
-
69
- it "stays quiet when --provider picks the provider" do
70
- _, error, = run("help", "--provider=demo")
71
-
72
- expect(error).to be_empty
73
- end
74
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe "elelem/shell" do
4
- let(:session) { Elelem.build(input: Elelem::NullInput.new, output: Elelem::NullOutput.new) }
5
-
6
- it "adds the elelem-tools tools" do
7
- expect(session.toolbox.tools.keys).to include("edit", "git", "grep", "verify")
8
- end
9
-
10
- it "adds the elelem-skills commands" do
11
- expect(session.commands.names).to include("/skills")
12
- end
13
-
14
- it "loads elelem-mcp" do
15
- expect(require("elelem/mcp")).to be(false)
16
- end
17
- end
data/spec/spec_helper.rb DELETED
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "../lib/elelem/shell"
4
-
5
- RSpec.configure do |config|
6
- config.disable_monkey_patching!
7
-
8
- config.expect_with :rspec do |c|
9
- c.syntax = :expect
10
- end
11
- end