Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
run: |
VERSION="${GITHUB_REF_NAME#v}"
sleep 10
npm view fred-cli@"$VERSION"
npm view @fiale-plus/fred-cli@"$VERSION"
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# fred-cli
# @fiale-plus/fred-cli

[![npm version](https://img.shields.io/npm/v/fred-cli.svg)](https://www.npmjs.com/package/fred-cli)
[![npm downloads](https://img.shields.io/npm/dm/fred-cli.svg)](https://www.npmjs.com/package/fred-cli)
[![npm version](https://img.shields.io/npm/v/@fiale-plus/fred-cli.svg)](https://www.npmjs.com/package/@fiale-plus/fred-cli)
[![npm downloads](https://img.shields.io/npm/dm/@fiale-plus/fred-cli.svg)](https://www.npmjs.com/package/@fiale-plus/fred-cli)
[![Test](https://github.com/fiale-plus/fred-cli/actions/workflows/test.yml/badge.svg)](https://github.com/fiale-plus/fred-cli/actions/workflows/test.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Expand All @@ -20,7 +20,7 @@
## Quick Start

```bash
npm install -g fred-cli
npm install -g @fiale-plus/fred-cli
export FRED_API_KEY=your-key-here

fred series search "consumer price index" --limit 5
Expand All @@ -34,10 +34,10 @@ Get a free API key at: https://fred.stlouisfed.org/docs/api/api_key.html

```bash
# Global (CLI usage)
npm install -g fred-cli
npm install -g @fiale-plus/fred-cli

# Local (library usage)
npm install fred-cli
npm install @fiale-plus/fred-cli
```

Requires Node.js >= 18.0.0.
Expand Down Expand Up @@ -148,7 +148,7 @@ The CLI respects FRED API defaults per endpoint. When results are paginated:
## Library Usage

```typescript
import { FredClient } from "fred-cli";
import { FredClient } from "@fiale-plus/fred-cli";

const fred = new FredClient(process.env.FRED_API_KEY!);

Expand Down Expand Up @@ -191,7 +191,7 @@ fred series GDP --api-key your-key-here

```bash
git clone https://github.com/fiale-plus/fred-cli.git
cd fred-cli
cd @fiale-plus/fred-cli
npm install
npm run build
npm test
Expand Down Expand Up @@ -219,7 +219,7 @@ This software is provided "AS IS" under the MIT License, without warranty of any
- [FRED API Documentation](https://fred.stlouisfed.org/docs/api/fred/)
- [API Key Registration](https://fred.stlouisfed.org/docs/api/api_key.html)
- [GitHub Repository](https://github.com/fiale-plus/fred-cli)
- [npm Package](https://www.npmjs.com/package/fred-cli)
- [npm Package](https://www.npmjs.com/package/@fiale-plus/fred-cli)

## License

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "fred-cli",
"name": "@fiale-plus/fred-cli",
"version": "0.0.0-dev",
"description": "Unofficial CLI and TypeScript client for the FRED API (Federal Reserve Economic Data) — designed for AI agents",
"type": "module",
Expand Down
3 changes: 2 additions & 1 deletion src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
TagFilterParams,
RelatedTagParams,
FredSeriesResponse,
FredSingleSeriesResponse,
FredObservationsResponse,
FredCategoryResponse,
FredReleasesResponse,
Expand Down Expand Up @@ -74,7 +75,7 @@ export class FredClient {

// ── Series ──────────────────────────────────────────────────────

async getSeries(seriesId: string, opts: RealtimeParams = {}): Promise<FredSeriesResponse> {
async getSeries(seriesId: string, opts: RealtimeParams = {}): Promise<FredSingleSeriesResponse> {
return this.request("series", { series_id: seriesId, ...opts });
}

Expand Down
7 changes: 7 additions & 0 deletions src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ export interface FredSeriesResponse extends FredPaginatedEnvelope {
seriess: FredSeries[];
}

/** Response for single-series lookup (no pagination envelope) */
export interface FredSingleSeriesResponse {
realtime_start: string;
realtime_end: string;
seriess: FredSeries[];
}

// ── Observation types ───────────────────────────────────────────────

export interface FredObservation {
Expand Down
1 change: 0 additions & 1 deletion src/cli/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const ARRAY_FIELDS = [
"sources",
"tags",
"vintage_dates",
"elements",
] as const;

type DataRecord = Record<string, unknown>;
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type {
FredSource,
FredTag,
FredSeriesResponse,
FredSingleSeriesResponse,
FredObservationsResponse,
FredCategoryResponse,
FredReleasesResponse,
Expand Down
Loading