@withone/cli 1.43.3 → 1.43.4
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.
- package/dist/index.js +14 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1979,8 +1979,9 @@ async function connectionListCommand(options) {
|
|
|
1979
1979
|
const accessFiltered = allowedKeys.includes("*") ? allConnections : allConnections.filter((conn) => allowedKeys.includes(conn.key));
|
|
1980
1980
|
const searchQuery = options?.search?.toLowerCase();
|
|
1981
1981
|
const filtered = searchQuery ? accessFiltered.filter((conn) => conn.platform.toLowerCase().includes(searchQuery)) : accessFiltered;
|
|
1982
|
+
const limitArg = options?.limit ? parseInt(options.limit, 10) : void 0;
|
|
1982
1983
|
if (isAgentMode()) {
|
|
1983
|
-
const limit =
|
|
1984
|
+
const limit = limitArg ?? 20;
|
|
1984
1985
|
const limited = filtered.slice(0, limit);
|
|
1985
1986
|
json({
|
|
1986
1987
|
total: filtered.length,
|
|
@@ -1999,6 +2000,7 @@ async function connectionListCommand(options) {
|
|
|
1999
2000
|
});
|
|
2000
2001
|
return;
|
|
2001
2002
|
}
|
|
2003
|
+
const displayed = limitArg !== void 0 ? filtered.slice(0, limitArg) : filtered;
|
|
2002
2004
|
spinner5.stop(`${filtered.length} connection${filtered.length === 1 ? "" : "s"} found`);
|
|
2003
2005
|
if (filtered.length === 0) {
|
|
2004
2006
|
if (searchQuery) {
|
|
@@ -2019,7 +2021,7 @@ Add one with: ${pc4.cyan("one connection add gmail")}`,
|
|
|
2019
2021
|
return;
|
|
2020
2022
|
}
|
|
2021
2023
|
console.log();
|
|
2022
|
-
const rows =
|
|
2024
|
+
const rows = displayed.map((conn) => ({
|
|
2023
2025
|
status: getStatusIndicator(conn.state),
|
|
2024
2026
|
platform: conn.platform,
|
|
2025
2027
|
state: conn.state,
|
|
@@ -2038,7 +2040,14 @@ Add one with: ${pc4.cyan("one connection add gmail")}`,
|
|
|
2038
2040
|
rows
|
|
2039
2041
|
);
|
|
2040
2042
|
console.log();
|
|
2041
|
-
|
|
2043
|
+
if (displayed.length < filtered.length) {
|
|
2044
|
+
p4.note(
|
|
2045
|
+
`Showing ${displayed.length} of ${filtered.length}. Increase --limit or run without it to see all.`,
|
|
2046
|
+
"Limited"
|
|
2047
|
+
);
|
|
2048
|
+
} else {
|
|
2049
|
+
p4.note(`Add more with: ${pc4.cyan("one connection add <platform>")}`, "Tip");
|
|
2050
|
+
}
|
|
2042
2051
|
} catch (error2) {
|
|
2043
2052
|
spinner5.stop("Failed to load connections");
|
|
2044
2053
|
error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
|
|
@@ -11052,7 +11061,7 @@ program.command("whoami").description("Show the user, organization, and project
|
|
|
11052
11061
|
program.command("add [platform]").description("Shortcut for: connection add").action(async (platform) => {
|
|
11053
11062
|
await connectionAddCommand(platform);
|
|
11054
11063
|
});
|
|
11055
|
-
program.command("list").alias("ls").description("Shortcut for: connection list").action(async () => {
|
|
11056
|
-
await connectionListCommand();
|
|
11064
|
+
program.command("list").alias("ls").description("Shortcut for: connection list").option("-s, --search <query>", "Filter connections by platform name").option("-l, --limit <n>", "Max connections to return (agent mode default: 20)").action(async (options) => {
|
|
11065
|
+
await connectionListCommand(options);
|
|
11057
11066
|
});
|
|
11058
11067
|
program.parse();
|