
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
@medplum/cli
Advanced tools
The Medplum CLI (Command Line Interface) is a set of command line tools to quickly deploy Medplum web applications and Medplum bots.
Add as a dependency:
npm install @medplum/cli
Create a Medplum config file called medplum.config.json:
{
"bots": [
{
"name": "hello-world",
"id": "f0465c2e-11d4-4c36-b834-8e86f7472b4b",
"source": "src/index.ts",
"dist": "dist/index.js"
}
]
}
The name property is a friendly name you can use to reference the Bot in commands.
The id property refers to the Bot ID in your Medplum project.
The source property is the file path to the original source. When you "save" the Bot, the contents of this file will be saved to the Bot code property. This file can be JavaScript or TypeScript.
The dist property is the optional file path to the compiled source. When you "deploy" the Bot, the contents of this file will be deployed to the Bot runtime. This file must be JavaScript.
Syntax:
medplum <command> <args>
Updates the code value on a Bot resource
Syntax:
medplum save-bot <bot name>
Example:
medplum save-bot hello-world
Deploys the Bot code
Syntax:
medplum deploy-bot <bot name>
Example:
medplum-deploy-bot <bot name>
Authentication requires client credentials in environment variables MEDPLUM_CLIENT_ID and MEDPLUM_CLIENT_SECRET. This supports most use cases, including secrets from CI/CD. dotenv is enabled, so you can store them in a .env file.
Create a Medplum config file medplum.config.json:
{
"bots": [
{
"name": "hello-world",
"id": "f0465c2e-11d4-4c36-b834-8e86f7472b4b",
"source": "src/hello-world.ts",
"dist": "dist/hello-world.js"
}
]
}
Replace the sample id with your Bot's ID.
Write your bot in src/hello-world.ts. This can be TypeScript. It can reference @medplum/core and node-fetch:
import { MedplumClient } from '@medplum/core';
import { Resource } from '@medplum/fhirtypes';
export async function handler(medplum: MedplumClient, event: BotEvent): Promise<any> {
console.log('Hello world');
}
You can use the Medplum CLI to save it:
npx medplum save-bot hello-world
Compile with vanilla tsc (no bundler required)
npx tsc
The result will be JavaScript output in dist/hello-world.js:
export async function handler(medplum, input) {
console.log('Hello world');
}
You can then use the Medplum CLI to deploy it.
npx medplum deploy-bot hello-world
Medplum is a healthcare platform that helps you quickly develop high-quality compliant applications. Medplum includes a FHIR server, React component library, and developer app.
Apache 2.0. Copyright © Medplum 2022
FAQs
Medplum Command Line Interface
The npm package @medplum/cli receives a total of 7,620 weekly downloads. As such, @medplum/cli popularity was classified as popular.
We found that @medplum/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.