Skip to content

feat(functions): add functions list command#380

Merged
yardend-wix merged 7 commits intofeature/functions-commandsfrom
feature/functions-list-command
Mar 12, 2026
Merged

feat(functions): add functions list command#380
yardend-wix merged 7 commits intofeature/functions-commandsfrom
feature/functions-list-command

Conversation

@yardend-wix
Copy link
Contributor

@yardend-wix yardend-wix commented Mar 8, 2026

Note

Description

Adds a base44 functions list command that fetches and displays all deployed backend functions along with a count of attached automations for each. The functions deploy command was refactored to remove its own parent functions command wrapper, and a new index.ts now assembles the unified functions parent command with both deploy and list subcommands registered under it.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • New functions list command (list.ts): Fetches all deployed backend functions via GET backend-functions and displays each function name with its automation count
  • Refactored deploy.ts: Renamed getFunctionsDeployCommand to getDeployCommand and stripped the parent functions command wrapper (now delegated to index.ts)
  • New functions/index.ts: Assembles the unified functions parent command, registering both deploy and list as subcommands
  • Updated program.ts: Switched import from getFunctionsDeployCommand to getFunctionsCommand from the new index
  • New Zod schemas (schema.ts): Added FunctionInfoSchema (with snake_case to camelCase transform), ListFunctionsResponseSchema, and ListFunctionsResponse type
  • New API function (api.ts): Added listDeployedFunctions() with proper error handling and schema validation
  • Tests (functions_list.spec.ts): 5 integration tests covering empty list, multiple functions, automation count display, missing project config, and API error handling
  • TestAPIServer: Added mockFunctionsList and mockFunctionsListError helpers for test mocking

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional Notes

The refactor of deploy.ts is a prerequisite for this feature — it moves command composition up to index.ts, enabling clean addition of further functions subcommands in the future. The FunctionInfoSchema reuses existing FunctionFileSchema and AutomationSchema types from the schema module.


🤖 Generated by Claude | 2026-03-12 00:00 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.44-pr.380.ca88494

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.44-pr.380.ca88494"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.44-pr.380.ca88494"
  }
}

Preview published to npm registry — try new features instantly!

yardend-wix and others added 2 commits March 9, 2026 11:30
Add a new `functions list` CLI command that lists all deployed functions
on the remote, showing automation counts. Restructure the functions
command group to use an index.ts that registers subcommands.

- Add ListFunctionsResponseSchema and FunctionInfo types to schema
- Add listDeployedFunctions API client function
- Create functions/list.ts command with automation count display
- Refactor functions/deploy.ts export to getDeployCommand
- Create functions/index.ts to register deploy + list subcommands
- Update program.ts to use getFunctionsCommand
- Add test mocks and 5 tests for the list command

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yardend-wix yardend-wix force-pushed the feature/functions-list-command branch from 813293a to 5c77e60 Compare March 9, 2026 09:35
Copy link
Collaborator

@kfirstri kfirstri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some small changes. also, can you add a picture of how does the output looks like?

@github-project-automation github-project-automation bot moved this from Backlog to Ready in CLI Development Mar 9, 2026
yardend-wix and others added 2 commits March 10, 2026 15:28
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deleted Base44APIMock.ts (replaced by TestAPIServer.ts in main) and added
mockFunctionsList / mockFunctionsListError methods to TestAPIServer so the
functions-list tests work with the new test infrastructure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kfirstri kfirstri moved this from Ready to In review in CLI Development Mar 11, 2026
Replace FunctionAutomationInfoSchema (3-field summary) with the existing
full AutomationSchema so list response correctly parses all automation
fields. Add entity automation to test mock alongside scheduled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yardend-wix yardend-wix changed the base branch from main to feature/functions-commands March 12, 2026 10:27
Copy link
Collaborator

@kfirstri kfirstri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny comment about runTask messaging

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yardend-wix yardend-wix merged commit 4ccd8e7 into feature/functions-commands Mar 12, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in CLI Development Mar 12, 2026
@yardend-wix yardend-wix deleted the feature/functions-list-command branch March 12, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants