Skip to content

Add functions pull#331

Merged
yardend-wix merged 3 commits intofeature/per-function-deploy-clifrom
feature/functions-pull-and-new
Feb 26, 2026
Merged

Add functions pull#331
yardend-wix merged 3 commits intofeature/per-function-deploy-clifrom
feature/functions-pull-and-new

Conversation

@yardend-wix
Copy link

@yardend-wix yardend-wix commented Feb 25, 2026

Note

Description

This PR adds a functions pull CLI command that downloads deployed backend functions from Base44 to the local filesystem. It creates function.jsonc config files and all source files for each pulled function, and intelligently skips functions whose local files already match the remote content to avoid unnecessary writes.

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

  • Added src/core/resources/function/pull.ts with writeFunctions() core logic that writes remote function data (config + source files) to local function directories
  • Added isFunctionUnchanged() helper that compares local vs remote function config (entry, automations) and all source file contents to skip unchanged functions
  • Added src/cli/commands/functions/pull.ts with the functions pull [name] command, supporting an optional name argument to pull a single function by name
  • Wired the new getPullCommand into the functions command group in src/cli/commands/functions/index.ts
  • Exported pull.ts from src/core/resources/function/index.ts

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 pull command follows the same runCommand/runTask pattern used by other function subcommands. The change-detection logic in isFunctionUnchanged compares both the config fields and raw file contents, ensuring a clean idempotent pull operation.


🤖 Generated by Claude | 2026-02-25 15:34 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Feb 25, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.33-pr.331.bd24d14

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.33-pr.331.bd24d14"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.33-pr.331.bd24d14"
  }
}

Preview published to npm registry — try new features instantly!

@claude
Copy link

claude bot commented Feb 25, 2026

README check ran. 8 issue(s) found and applied: added missing commands to the command table (functions new, functions pull, functions list, functions delete, connectors pull, connectors push, types generate) and uncommented eject with corrected description. README.md has been updated in this branch.

@yardend-wix yardend-wix force-pushed the feature/functions-pull-and-new branch from fbc1f56 to df8220c Compare February 25, 2026 14:37
@yardend-wix yardend-wix changed the title Add functions pull and new commands Add functions pull Feb 25, 2026
yardend-wix and others added 3 commits February 25, 2026 17:33
- `functions new <name>` — scaffold a new function with config and
  template index.ts
- `functions pull [name]` — download function source from remote,
  optionally filtering by name. Skips unchanged files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the scaffold command per PM feedback. Align pull command
description with other functions subcommands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously only compared source file contents, missing changes to
entry point or automations in function.jsonc. Now reads and compares
the local config before checking source files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yardend-wix yardend-wix force-pushed the feature/functions-pull-and-new branch from df8220c to 8e69301 Compare February 25, 2026 15:34
@yardend-wix yardend-wix merged commit 42da2ec into feature/per-function-deploy-cli Feb 26, 2026
4 of 5 checks passed
@yardend-wix yardend-wix deleted the feature/functions-pull-and-new branch February 26, 2026 15:25
@github-project-automation github-project-automation bot moved this from Backlog to Done in CLI Development Feb 26, 2026
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.

1 participant