merge-workforce 0.1.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Merge
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,117 @@
1
+ Metadata-Version: 2.4
2
+ Name: merge-workforce
3
+ Version: 0.1.0
4
+ Summary: Merge for Workforce CLI (mfw) — models, tool-calling, and admin provisioning from the terminal.
5
+ Author-email: Merge <support@merge.dev>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://merge.dev
8
+ Project-URL: Repository, https://github.com/merge-api/merge-workforce-cli
9
+ Keywords: merge,workforce,cli,gateway,mcp,llm
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: typer==0.12.5
20
+ Requires-Dist: click==8.1.8
21
+ Requires-Dist: httpx==0.27.2
22
+ Dynamic: license-file
23
+
24
+ # Merge for Workforce CLI (`mfw`)
25
+
26
+ A command-line tool for Merge for Workforce employees: log in with your IdP, get
27
+ a Gateway credential, and use your provisioned models and tools from the terminal.
28
+
29
+ ## Install
30
+
31
+ ```bash
32
+ pipx install merge-workforce # recommended (isolated env, puts `mfw` on PATH)
33
+ pip install merge-workforce # alternative
34
+ ```
35
+
36
+ [`pipx`][pipx] keeps the tool in its own environment and avoids the
37
+ "externally-managed-environment" error a plain `pip install` hits on modern
38
+ Python. One-time setup: `brew install pipx && pipx ensurepath` (macOS) or
39
+ `python3 -m pip install --user pipx && pipx ensurepath` (Linux). Update later
40
+ with `pipx upgrade merge-workforce`. Requires Python 3.10+.
41
+
42
+ > Before the first PyPI release you can install straight from the repo:
43
+ > `pipx install git+ssh://git@github.com/merge-api/merge-workforce-cli.git`.
44
+
45
+ ## Quickstart
46
+
47
+ ```bash
48
+ mfw login --gateway-url https://ah-api.merge.dev # opens your browser to sign in
49
+ mfw setup # provision this device's Gateway credential
50
+ mfw models # list the models you can use
51
+ mfw ask -m openai/gpt-4o-mini "hello" # one prompt to a chosen model
52
+ mfw chat -m openai/gpt-4o-mini "use my tools to …" # an agent that can call your provisioned tools
53
+ ```
54
+
55
+ Set `MFW_GATEWAY_URL` once and you can drop `--gateway-url` from every command.
56
+
57
+ > **You must be a provisioned employee.** `mfw setup` mints your key only once
58
+ > your admin has activated Merge for Workforce and your group has a Gateway
59
+ > project. If `setup` returns "your admin has not finished setting up Merge
60
+ > Gateway for your group yet", that setup isn't complete — it's not a CLI error.
61
+
62
+ ## Commands
63
+
64
+ Run `mfw --help`, or `mfw <command> --help` for details on any one.
65
+
66
+ | Command | What it does |
67
+ |---|---|
68
+ | `mfw login` | Browser IdP login; stores a short-lived access token. |
69
+ | `mfw setup` | Provision this device's Gateway credential (per-device, revocable). |
70
+ | `mfw models` | List the models served for you. The id is what you pass as `--model`. |
71
+ | `mfw ask -m <id> "…"` | Send one prompt to a chosen model through the Gateway. |
72
+ | `mfw chat -m <id> "…"` | Run an agent that can call your provisioned tools (MCP tool loop). |
73
+ | `mfw mcp [--write .mcp.json]` | Emit an MCP config so an external client (Claude Code, Cursor) can use your tools. |
74
+ | `mfw run -- <cmd> …` | Run a command with the Gateway credential injected as env (OpenAI-compatible). |
75
+ | `mfw creds [--export]` | Show (or `export`) the provisioned Gateway credential. |
76
+ | `mfw whoami` / `mfw logout` | Show login state / clear the stored token. |
77
+
78
+ The Gateway routes and bills every call and **enforces your allowlist**, so a
79
+ model or tool you aren't provisioned for comes back as a request error, never a
80
+ silent fallback.
81
+
82
+ ## Usage with AI agents
83
+
84
+ Two ways to give an AI agent your provisioned models and tools, both governed by
85
+ your org:
86
+
87
+ - **`mfw chat`** is a built-in agent — it drives a model through the Gateway and
88
+ calls your provisioned tools over MCP, no other client needed.
89
+ - **`mfw mcp`** hands your tools to an external MCP client (Claude Code, Cursor,
90
+ any SDK agent). Write the config where the client reads it:
91
+
92
+ ```bash
93
+ mfw mcp --write .mcp.json # Claude Code picks this up from the project root
94
+ ```
95
+
96
+ The config points the client at the backend's MCP endpoint with a short-lived
97
+ token, so the agent calls tools **as you**, exactly as the console governs them.
98
+ Re-run when the token lapses.
99
+
100
+ For OpenAI-SDK tools, `mfw run -- <command>` injects `OPENAI_API_KEY` /
101
+ `OPENAI_BASE_URL` pointed at the Gateway, so the tool routes through it unchanged.
102
+
103
+ ## How it works
104
+
105
+ - **Login** is OAuth 2.0 Authorization Code + PKCE with a loopback redirect
106
+ (RFC 8252): the public client `merge-workforce-cli` (no secret on the laptop),
107
+ your browser → `<gateway>/o/authorize/` → IdP login + consent → code returns to
108
+ `http://localhost:{9410-9419}/callback` → exchanged at `<gateway>/o/token/`. The
109
+ access token is stored in `~/.mfw/credentials.json` (`0600`).
110
+ - **Setup** exchanges that token for a per-device Gateway API key
111
+ (`~/.mfw/gateway_credential.json`), the same per-device path the desktop client
112
+ uses — independently revocable, with spend attributed to you.
113
+ - **Models** are the maintained `/v1/responses` surface; `chat` connects your
114
+ provisioned tools over the backend's OAuth-authed `/mcp/` endpoint and runs the
115
+ function-calling loop for you.
116
+
117
+ [pipx]: https://pipx.pypa.io/
@@ -0,0 +1,94 @@
1
+ # Merge for Workforce CLI (`mfw`)
2
+
3
+ A command-line tool for Merge for Workforce employees: log in with your IdP, get
4
+ a Gateway credential, and use your provisioned models and tools from the terminal.
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ pipx install merge-workforce # recommended (isolated env, puts `mfw` on PATH)
10
+ pip install merge-workforce # alternative
11
+ ```
12
+
13
+ [`pipx`][pipx] keeps the tool in its own environment and avoids the
14
+ "externally-managed-environment" error a plain `pip install` hits on modern
15
+ Python. One-time setup: `brew install pipx && pipx ensurepath` (macOS) or
16
+ `python3 -m pip install --user pipx && pipx ensurepath` (Linux). Update later
17
+ with `pipx upgrade merge-workforce`. Requires Python 3.10+.
18
+
19
+ > Before the first PyPI release you can install straight from the repo:
20
+ > `pipx install git+ssh://git@github.com/merge-api/merge-workforce-cli.git`.
21
+
22
+ ## Quickstart
23
+
24
+ ```bash
25
+ mfw login --gateway-url https://ah-api.merge.dev # opens your browser to sign in
26
+ mfw setup # provision this device's Gateway credential
27
+ mfw models # list the models you can use
28
+ mfw ask -m openai/gpt-4o-mini "hello" # one prompt to a chosen model
29
+ mfw chat -m openai/gpt-4o-mini "use my tools to …" # an agent that can call your provisioned tools
30
+ ```
31
+
32
+ Set `MFW_GATEWAY_URL` once and you can drop `--gateway-url` from every command.
33
+
34
+ > **You must be a provisioned employee.** `mfw setup` mints your key only once
35
+ > your admin has activated Merge for Workforce and your group has a Gateway
36
+ > project. If `setup` returns "your admin has not finished setting up Merge
37
+ > Gateway for your group yet", that setup isn't complete — it's not a CLI error.
38
+
39
+ ## Commands
40
+
41
+ Run `mfw --help`, or `mfw <command> --help` for details on any one.
42
+
43
+ | Command | What it does |
44
+ |---|---|
45
+ | `mfw login` | Browser IdP login; stores a short-lived access token. |
46
+ | `mfw setup` | Provision this device's Gateway credential (per-device, revocable). |
47
+ | `mfw models` | List the models served for you. The id is what you pass as `--model`. |
48
+ | `mfw ask -m <id> "…"` | Send one prompt to a chosen model through the Gateway. |
49
+ | `mfw chat -m <id> "…"` | Run an agent that can call your provisioned tools (MCP tool loop). |
50
+ | `mfw mcp [--write .mcp.json]` | Emit an MCP config so an external client (Claude Code, Cursor) can use your tools. |
51
+ | `mfw run -- <cmd> …` | Run a command with the Gateway credential injected as env (OpenAI-compatible). |
52
+ | `mfw creds [--export]` | Show (or `export`) the provisioned Gateway credential. |
53
+ | `mfw whoami` / `mfw logout` | Show login state / clear the stored token. |
54
+
55
+ The Gateway routes and bills every call and **enforces your allowlist**, so a
56
+ model or tool you aren't provisioned for comes back as a request error, never a
57
+ silent fallback.
58
+
59
+ ## Usage with AI agents
60
+
61
+ Two ways to give an AI agent your provisioned models and tools, both governed by
62
+ your org:
63
+
64
+ - **`mfw chat`** is a built-in agent — it drives a model through the Gateway and
65
+ calls your provisioned tools over MCP, no other client needed.
66
+ - **`mfw mcp`** hands your tools to an external MCP client (Claude Code, Cursor,
67
+ any SDK agent). Write the config where the client reads it:
68
+
69
+ ```bash
70
+ mfw mcp --write .mcp.json # Claude Code picks this up from the project root
71
+ ```
72
+
73
+ The config points the client at the backend's MCP endpoint with a short-lived
74
+ token, so the agent calls tools **as you**, exactly as the console governs them.
75
+ Re-run when the token lapses.
76
+
77
+ For OpenAI-SDK tools, `mfw run -- <command>` injects `OPENAI_API_KEY` /
78
+ `OPENAI_BASE_URL` pointed at the Gateway, so the tool routes through it unchanged.
79
+
80
+ ## How it works
81
+
82
+ - **Login** is OAuth 2.0 Authorization Code + PKCE with a loopback redirect
83
+ (RFC 8252): the public client `merge-workforce-cli` (no secret on the laptop),
84
+ your browser → `<gateway>/o/authorize/` → IdP login + consent → code returns to
85
+ `http://localhost:{9410-9419}/callback` → exchanged at `<gateway>/o/token/`. The
86
+ access token is stored in `~/.mfw/credentials.json` (`0600`).
87
+ - **Setup** exchanges that token for a per-device Gateway API key
88
+ (`~/.mfw/gateway_credential.json`), the same per-device path the desktop client
89
+ uses — independently revocable, with spend attributed to you.
90
+ - **Models** are the maintained `/v1/responses` surface; `chat` connects your
91
+ provisioned tools over the backend's OAuth-authed `/mcp/` endpoint and runs the
92
+ function-calling loop for you.
93
+
94
+ [pipx]: https://pipx.pypa.io/
@@ -0,0 +1,117 @@
1
+ Metadata-Version: 2.4
2
+ Name: merge-workforce
3
+ Version: 0.1.0
4
+ Summary: Merge for Workforce CLI (mfw) — models, tool-calling, and admin provisioning from the terminal.
5
+ Author-email: Merge <support@merge.dev>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://merge.dev
8
+ Project-URL: Repository, https://github.com/merge-api/merge-workforce-cli
9
+ Keywords: merge,workforce,cli,gateway,mcp,llm
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: typer==0.12.5
20
+ Requires-Dist: click==8.1.8
21
+ Requires-Dist: httpx==0.27.2
22
+ Dynamic: license-file
23
+
24
+ # Merge for Workforce CLI (`mfw`)
25
+
26
+ A command-line tool for Merge for Workforce employees: log in with your IdP, get
27
+ a Gateway credential, and use your provisioned models and tools from the terminal.
28
+
29
+ ## Install
30
+
31
+ ```bash
32
+ pipx install merge-workforce # recommended (isolated env, puts `mfw` on PATH)
33
+ pip install merge-workforce # alternative
34
+ ```
35
+
36
+ [`pipx`][pipx] keeps the tool in its own environment and avoids the
37
+ "externally-managed-environment" error a plain `pip install` hits on modern
38
+ Python. One-time setup: `brew install pipx && pipx ensurepath` (macOS) or
39
+ `python3 -m pip install --user pipx && pipx ensurepath` (Linux). Update later
40
+ with `pipx upgrade merge-workforce`. Requires Python 3.10+.
41
+
42
+ > Before the first PyPI release you can install straight from the repo:
43
+ > `pipx install git+ssh://git@github.com/merge-api/merge-workforce-cli.git`.
44
+
45
+ ## Quickstart
46
+
47
+ ```bash
48
+ mfw login --gateway-url https://ah-api.merge.dev # opens your browser to sign in
49
+ mfw setup # provision this device's Gateway credential
50
+ mfw models # list the models you can use
51
+ mfw ask -m openai/gpt-4o-mini "hello" # one prompt to a chosen model
52
+ mfw chat -m openai/gpt-4o-mini "use my tools to …" # an agent that can call your provisioned tools
53
+ ```
54
+
55
+ Set `MFW_GATEWAY_URL` once and you can drop `--gateway-url` from every command.
56
+
57
+ > **You must be a provisioned employee.** `mfw setup` mints your key only once
58
+ > your admin has activated Merge for Workforce and your group has a Gateway
59
+ > project. If `setup` returns "your admin has not finished setting up Merge
60
+ > Gateway for your group yet", that setup isn't complete — it's not a CLI error.
61
+
62
+ ## Commands
63
+
64
+ Run `mfw --help`, or `mfw <command> --help` for details on any one.
65
+
66
+ | Command | What it does |
67
+ |---|---|
68
+ | `mfw login` | Browser IdP login; stores a short-lived access token. |
69
+ | `mfw setup` | Provision this device's Gateway credential (per-device, revocable). |
70
+ | `mfw models` | List the models served for you. The id is what you pass as `--model`. |
71
+ | `mfw ask -m <id> "…"` | Send one prompt to a chosen model through the Gateway. |
72
+ | `mfw chat -m <id> "…"` | Run an agent that can call your provisioned tools (MCP tool loop). |
73
+ | `mfw mcp [--write .mcp.json]` | Emit an MCP config so an external client (Claude Code, Cursor) can use your tools. |
74
+ | `mfw run -- <cmd> …` | Run a command with the Gateway credential injected as env (OpenAI-compatible). |
75
+ | `mfw creds [--export]` | Show (or `export`) the provisioned Gateway credential. |
76
+ | `mfw whoami` / `mfw logout` | Show login state / clear the stored token. |
77
+
78
+ The Gateway routes and bills every call and **enforces your allowlist**, so a
79
+ model or tool you aren't provisioned for comes back as a request error, never a
80
+ silent fallback.
81
+
82
+ ## Usage with AI agents
83
+
84
+ Two ways to give an AI agent your provisioned models and tools, both governed by
85
+ your org:
86
+
87
+ - **`mfw chat`** is a built-in agent — it drives a model through the Gateway and
88
+ calls your provisioned tools over MCP, no other client needed.
89
+ - **`mfw mcp`** hands your tools to an external MCP client (Claude Code, Cursor,
90
+ any SDK agent). Write the config where the client reads it:
91
+
92
+ ```bash
93
+ mfw mcp --write .mcp.json # Claude Code picks this up from the project root
94
+ ```
95
+
96
+ The config points the client at the backend's MCP endpoint with a short-lived
97
+ token, so the agent calls tools **as you**, exactly as the console governs them.
98
+ Re-run when the token lapses.
99
+
100
+ For OpenAI-SDK tools, `mfw run -- <command>` injects `OPENAI_API_KEY` /
101
+ `OPENAI_BASE_URL` pointed at the Gateway, so the tool routes through it unchanged.
102
+
103
+ ## How it works
104
+
105
+ - **Login** is OAuth 2.0 Authorization Code + PKCE with a loopback redirect
106
+ (RFC 8252): the public client `merge-workforce-cli` (no secret on the laptop),
107
+ your browser → `<gateway>/o/authorize/` → IdP login + consent → code returns to
108
+ `http://localhost:{9410-9419}/callback` → exchanged at `<gateway>/o/token/`. The
109
+ access token is stored in `~/.mfw/credentials.json` (`0600`).
110
+ - **Setup** exchanges that token for a per-device Gateway API key
111
+ (`~/.mfw/gateway_credential.json`), the same per-device path the desktop client
112
+ uses — independently revocable, with spend attributed to you.
113
+ - **Models** are the maintained `/v1/responses` surface; `chat` connects your
114
+ provisioned tools over the backend's OAuth-authed `/mcp/` endpoint and runs the
115
+ function-calling loop for you.
116
+
117
+ [pipx]: https://pipx.pypa.io/
@@ -0,0 +1,17 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ merge_workforce.egg-info/PKG-INFO
5
+ merge_workforce.egg-info/SOURCES.txt
6
+ merge_workforce.egg-info/dependency_links.txt
7
+ merge_workforce.egg-info/entry_points.txt
8
+ merge_workforce.egg-info/requires.txt
9
+ merge_workforce.egg-info/top_level.txt
10
+ tests/test_agent.py
11
+ workforce_cli/__init__.py
12
+ workforce_cli/agent.py
13
+ workforce_cli/api.py
14
+ workforce_cli/auth.py
15
+ workforce_cli/cli.py
16
+ workforce_cli/config.py
17
+ workforce_cli/mcp_client.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ mfw = workforce_cli.cli:main
@@ -0,0 +1,3 @@
1
+ typer==0.12.5
2
+ click==8.1.8
3
+ httpx==0.27.2
@@ -0,0 +1 @@
1
+ workforce_cli
@@ -0,0 +1,48 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "merge-workforce"
7
+ version = "0.1.0"
8
+ description = "Merge for Workforce CLI (mfw) — models, tool-calling, and admin provisioning from the terminal."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.10"
12
+ authors = [{ name = "Merge", email = "support@merge.dev" }]
13
+ keywords = ["merge", "workforce", "cli", "gateway", "mcp", "llm"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Intended Audience :: Developers",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ ]
22
+ dependencies = [
23
+ "typer==0.12.5",
24
+ # Pinned: typer 0.12.5 calls click's pre-8.2 Parameter.make_metavar() (no
25
+ # ctx arg). click 8.2+ made ctx required, so an unpinned install floats to
26
+ # 8.5.x and every `mfw` command crashes in help rendering. 8.1.8 is the last
27
+ # 8.1.x and the newest click typer 0.12.5 renders against.
28
+ "click==8.1.8",
29
+ "httpx==0.27.2",
30
+ ]
31
+
32
+ [project.urls]
33
+ Homepage = "https://merge.dev"
34
+ Repository = "https://github.com/merge-api/merge-workforce-cli"
35
+
36
+ [project.scripts]
37
+ mfw = "workforce_cli.cli:main"
38
+
39
+ [tool.setuptools.packages.find]
40
+ where = ["."]
41
+ include = ["workforce_cli*"]
42
+
43
+ [tool.ruff]
44
+ line-length = 88
45
+ target-version = "py310"
46
+
47
+ [tool.ruff.lint]
48
+ select = ["E", "F", "I", "N"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+